xxxxxxxxxx
num = 123456
print(str(num)[::-1])
xxxxxxxxxx
def reverse(num):
rev = 0
while num > 0:
reminder = num % 10
rev = (rev * 10) + reminder
num = num // 10
return rev
print(f'reverse the number of {reverse(12345)}')
xxxxxxxxxx
# using for loop
number = 123
s = str(number)
op = ""
for i in s:
op = i + op
print(op)