Guest User

Untitled

a guest
Oct 17th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ...
  2. Ask the user for a string and print out whether this string is a palindrome or not. (A palindrome is a string that reads the same forwards and backwards.)
  3. Added lower/uppercase solution
  4. Added time processing feedback and time delay
  5. ...
  6.  
  7. import time
  8. import sys
  9. a = input("Give me a word please: ").lower()
  10. print("Word: " + a + " is processed...")
  11. process = (".....")
  12. for char in process:
  13. sys.stdout.write(char)
  14. sys.stdout.flush()
  15. time.sleep(0.4)
  16. b =a[::-1]
  17. print("This word in reverse is: " + b)
  18. if b == a:
  19. print("This is a palindrome!")
  20. else:
  21. print("That word is not a palindrome")
Add Comment
Please, Sign In to add comment