Answer to Question #241918 in Python for H A

Question #241918

1.  Flip the number: Write a program that prompts the user to enter a three digits positive integer. The program flips and prints the integer. For example, if the user enters 582 then the program prints 285.


simple output:

  1. Enter a 3-digits positive integer: 371 The flipped value of 371 is 173.
  2. Enter a 3-digits positive integer: 690 The flipped value of 690 is 96.
1
Expert's answer
2021-09-25T03:03:20-0400
N = int(input())
res = ""
for i in range(3):
    res += "{}".format(N%10)
    N = N // 10


print (res)

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