Python Practice › String Programs › Program 49

Mirror image of a string

EasyString Programs · 49 of 106

Write a Python program to print the mirror image (reverse) of a string.

Advertisement
Input
"Python"
Output
nohtyP

Approach

  1. [::-1].

Solution

Python
print("Python"[::-1])
Output
nohtyP
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More string programs

← All 106 String Programs