Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- 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.)
- Added lower/uppercase solution
- Added time processing feedback and time delay
- ...
- import time
- import sys
- a = input("Give me a word please: ").lower()
- print("Word: " + a + " is processed...")
- process = (".....")
- for char in process:
- sys.stdout.write(char)
- sys.stdout.flush()
- time.sleep(0.4)
- b =a[::-1]
- print("This word in reverse is: " + b)
- if b == a:
- print("This is a palindrome!")
- else:
- print("That word is not a palindrome")
Add Comment
Please, Sign In to add comment