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".