Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exit_word = "imUnknown"
- while True:
- my_text = input("Word: ")
- splitted = my_text.split(' ')
- my_text = "".join(splitted)
- left = ""
- right = ""
- for i in range(int(len(my_text)/2)):
- left = my_text[i].lower()
- right = my_text[-(i+1)].lower()
- if left != right:
- print(my_text, "is not palindrome")
- break
- else:
- print(my_text, "is a palindrome word")
- if my_text == exit_word:
- break
- else:
- print("------------------------------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement