I want a Three Line Code
first Line should be string Input
second line should be the process in which sting is getting reverse
and third line should be output showing its reverse
and the Language used is Python
I have taken a input like = racecar
so i need output as = racecar
so the process of reversing the string should be of 1 line only..
>Solution :
Here you have what you requested:
a = input("")
b = a[::-1]
print(b)
The line a = input("") will ask the user an input and store it in the variable a as a string type.
The line b = a[::-1] will reverse the string and store the result in variable b.
The line print(b) will print result.
You can do it in one line with:
print(input("")[::-1])