Close
Close

solve this

   monah

A 4 digit number is entered through keyboard. Write a program to print a new number with digits reversed as of orignal one. E.g.- INPUT : 1234 OUTPUT : 4321 INPUT : 5982 OUTPUT : 2895 

  • x = input() print(x[::-1])
    - hessam_kk
  • After looking at the answer written here, I realised that I think too long...
    - Aarush Tiwari

Answers

  •    dilip@6969

    x = [1,2,3,4] #here x is considered as a list.

    var=x[: : -1] 

    print(var)

    o/p will be [4,3,2,1]



  •    hessam_kk

    x = input()

    print(x[::-1])



Write your answer