digits of a number in python code example
Example 1: for each digit in number python
for digit in str(n):
print(int(digit))
Example 2: sum of any numbers in python
sum(list(map(int,input().split())))
for digit in str(n):
print(int(digit))
sum(list(map(int,input().split())))