93.1k views
3 votes
Rewrite following program using for loop no=3456 while no>0 : print(no%10) no=no/10

2 Answers

5 votes
No =3456
Your welcome I just took a test with this on it
User Fetz
by
5.1k points
6 votes

Answer:

no=3456

for x in reversed(str(no)):

print(x)

Step-by-step explanation:

If you turn the number into a string and then reverse it, you can achieve the same output.

User Vprajan
by
4.7k points