Untitled

 avatar
user_5757903
plain_text
a year ago
338 B
4
Indexable
while True:
    string = input("Enter a string (or exit): ")
    
    if string == "exit":
        print("You exit the game.")
        break
    
    # Check if the string is symmetric
    if string == string[::-1]:
        print("The input string is symmetric.")
    else:
        print("The input string is not symmetric.")
Editor is loading...
Leave a Comment