Q. Try writing program (similar to previous one ) for three digit number i.e. , if you input 123 , the program should print 321.


You can understand by Watching video :-



Answer :-

a = int(input("Enter a three digit number = "))
b = a // 10
c= b // 10
d = b % 10
e = a % 10
print("Number in reverse order = ",e,d,c)

Output :-

Enter a three digit number = 256
Number in reverse order =  6 5 2

>>>

Enter a three digit number = 987
Number in reverse order =  7 8 9

>>> 

Enter a three digit number = 369
Number in reverse order =  9 6 3

>>>

6 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post