144k views
5 votes
Can you explain the process for this problem please.

num = 120

while num > 0:

digit = num % 10

print(digit, end='')

num //= 10

1 Answer

4 votes

Answer:

Looks like a number reverser

Step-by-step explanation:

The loop copies the last digit, prints it, then removes it by dividing by 10.

User Kevingoos
by
5.3k points