+ 1
How to separate numbers?
Example: Input: 123 Output: 1 2 3
3 Respostas
+ 3
Convert it into string using str(num) function then use run a for loop:
Code
for i in str(num):
print(i)
+ 2
Quarkom
Ok then declare a variable with value 0 outside the loop and within the loop convert single digit again into intiger using int function and add them to declared variable like variable+=int(i)
That's all
0
丹ⓨㄩک廾 I mean, I would like to sum up all of digits 1,2,3 after