Answer:
stack = []
number = int(input("Enter a number: "))
while number > 0:
stack.append(number % 10)
number = int(number / 10)
while len(stack) > 0:
print(stack.pop(), end=" ")
Step-by-step explanation:
Initialize an empty list to represent the stack
Get a number from the user
Create a while loop that iterates through the given number and append its last digit to stack
When the first loop is done, your stack is filled with the digits of the given number
Create another while loop that iterates through your stack and prints its elements, digits of the number, separated by spaces