n=int(input('enter number:')) reverse=0 while(n!=0): rem=n%10 reverse=reverse*10+rem n=n//10 print(reverse) (OR) n=int(input('enter number')) print(int(str(n)[::-1]))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter