text1 = input("введите текст: ") text2 = "" for i in range(len(text1)-1,-1,-1): text2 += text1[i] print("текст наоборот:",text2)
и
text1 = input("введите текст: ") text2 = "" n = len(text1) for i in range(n): text2 += text1[n-1-i] print("текст наоборот:",text2)