You can reverse a string using the slice function
trial = "examplestring"
new_trial = trial[::-1]print(new_trial)You can also reverse a string with recursion
def string_reversal(str): if len(str) == 0: return str else: return string_reversal(str[1:]) + str[0]
str = "examplestring"reverse = string_reversal(str)
print(reverse)