Computer Science, asked by sarkarchanchal200, 1 year ago

WAP to take a 3-digit number and then print the reversed number. That is, if the input given is 123, the program should print 321 in python.

Answers

Answered by karanjotgaidu
7

Note:

This is a general program and you can find reverse of any digit no.

Program:

N=int(input('Enter the number'))

R=0

while N>0:

D=N%10

R=R*10+D

N=N//10

print("Reverse of the number=",R)

Answered by gaganadithyareddy9
4

Answer:

Hey! Here is your python code...

x = int(input("Enter a number: "))

print("Reversed number = ", end='')

for i in range(len(str(x))):

   print(str(x)[-i-1], end='')

# HOPE THIS HELPS!!

Similar questions