Previous Post:
Next Post :
Source Code:
Output:
Explanation:
User also seen : Reversing of the Given number
Compile Your code COMPILE NOW
Next Post :
Coming soon...
Source Code:
variable1 = str(input("Enter the String to be reversed : "))
print "Before Reversing : ", variable
variable2 = (variable[::-1])
print "After Reversing: ", variable2
Output:
Enter the String to be reversed : Dharani
Before Reversing : Dharani
After Reversing : inarahD
Explanation:
- Get the Input from the user.
- Using String slicing operation [::value] the list is revered. Here -1 is used because from the last the values will be taken.
- Print the output.
User also seen : Reversing of the Given number
Compile Your code COMPILE NOW
Thanks and regards,
Tech bird
Comments