Answer to Question #221643 in Python for Mikey Meegan

Question #221643

Write a Python program that reads in an integer and then displays the digits in that integer in reverse order


1
Expert's answer
2021-07-29T23:31:53-0400
 
num = int(input('Enter  number to be reversed: '))


#initiate reverse to 0
reverse = 0
 
while(num > 0):
    #logic
    mod = num % 10
    reverse = reverse * 10 + mod
    num = num // 10
 
print('Number after reversed is ', reverse)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS