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 Dictionary

  Removing Dictionary Items Dictionary items can be removed using built-in deletion methods that work on keys: del :  removes an item using ...