Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input("n = "))
- nInitial = n
- nDigits = 0
- for i in range(10):
- if n / (10**i) < 1:
- nDigits = i
- break
- print("nDigits = " + str(nDigits))
- digits = list()
- for i in range(nDigits-1, -1, -1):
- digit = n // (10**i)
- n = n - digit * (10**i)
- digits.append(digit)
- print(digits)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement