Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Reverse

Solution 😎

text = input("write a phrase: ")
result = text[::-1]
print("reverse:", result)

We use Python's slice notation ([::-1]) to reverse the order of the characters in the text string. The [::-1] notation means "start at the end of the string and move backwards by one character at a time". So, for example, if text is "hello", then text[::-1] is "olleh".

Video Solution 📹

Reverse

<iframe width="560" height="315" src="https://www.youtube.com/embed/jztSIJbiIVA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>