Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. while True:
  2. text = raw_input("Please enter a word: ")
  3. neg = text[::-1]
  4.  
  5. if text == neg:
  6. print "This is a Palindrome"
  7. else:
  8. print "This is NOT a Palindrome"
  9.  
  10. while True:
  11. repeat = raw_input("Do you want to restart? (y/n): ")
  12. if repeat in ('y', 'n'):
  13. break
  14. print "invalid input"
  15. if repeat == 'y':
  16. continue
  17. else:
  18. print "Goodbye"
  19. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement