write a python program to reverse the given number provided by the user using function
Answers
Answered by
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
Science,
1 month ago
Computer Science,
1 month ago
Science,
3 months ago
English,
3 months ago
Math,
10 months ago