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

What is a superconductor?

 A superconductor is a material that can conduct electricity with zero electrical resistance when it is cooled below a specific, very cold t...