Monday, May 25, 2020

Python:How to convert a number into a list of its digits

Let the number be 'n',

then

l=[int(x) for x in str(n)]


No comments:

Post a Comment

Python script to show Laptop Battery Percentage

Source:  https://www.geeksforgeeks.org/python-script-to-show-laptop-battery-percentage/ # python script showing battery details  import psut...