#programme to reverse a number string num=int(raw_input("Enter number : ")) #input from user c=0 while num>0 : c=c*10+num%10 num=num/10 print "Reverse number is : ",c
1.Enter number to reverse
2.It will show reverse number
Environment used : Ubuntu
Python : python 2.x or 3.x
No comments:
Post a Comment