I am trying to create a function in which python must print each individual digit of the number in a different line. I have to deal with numbers and digits mathematically instead of strings. However as I initially approached it I approached it using the string method to have some grasp on where to begin. However the code I did works as I need it to only if the user inputs a group numbers that are separated by commas. I want for the user to input for example; (my_numbers(4523)):
4
5
2
3
Here is the code i've been working on:
def my_numbers():
item = input('enter num:')
result='\n'.join(item.split(','))
print(result)
my_numbers()