Python Practice › String Programs › Program 49
Mirror image of a string
Write a Python program to print the mirror image (reverse) of a string.
Input
"Python"
Output
nohtyP
Approach
[::-1].
Solution
print("Python"[::-1])Output
nohtyP
Learn the concept
New to this topic? Read the lesson, then come back.