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

Sacred Thought

5 May 2024 Hari Om Verse 50-51, chapter two:  In this chapter two Shree krishna explains a simple way of living. Free from desires and void ...