Computer Science, asked by isaacskellington, 1 month ago

write a python program to reverse the given number provided by the user using function​

Answers

Answered by janugadipudi
1

Explanation:

num = int(input("Enter the number: "))

revr_num = 0 # initial value is 0. It will hold the reversed number.

def recur_reverse(num):

global revr_num # We can use it out of the function.

if (num > 0):

Reminder = num % 10.

revr_num = (revr_num * 10) + Reminder.

recur_reverse(num // 10)

Similar questions