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

Resources for preparing for SDE2/SDE3 roles

Software Design principals and patterns. (Design Patterns)  1.  https://bytebytego.com/ 2.  https://refactoring.guru/