Python program to reverse user defined value using function.

#Fucntion that reverse userdefined value.

N = int(input("Enter Number to reverse: "))

def REVERSE():
    global N
    Rev = 0
    O = N
    while N != 0 :
        Rev = Rev * 10
        Rev = Rev + (N%10)
        N = N // 10
    print("Reverse of %d"% O,"is: %d" % Rev)
    return

REVERSE()

Comments

  1. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
    Python Training in Bangalore

    ReplyDelete
  2. Replies
    1. Output depends upon user entered value.It mean if you entered 123 then output will be 321

      Delete

Post a Comment

Popular posts from this blog

Python program to calculate age and year when user will be 100 years old

Python program to print numbers less than 5 from the list.