7.9 LAB: Palindrome
LAB
ACTIVITY
7.9.1: LAB: Palindrome
Full screen
0/10
A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob", "sees", or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.
Ex: If the input is:
bob
the output is:
palindrome: bob
Ex: If the input is:
bobby
the output is:
not a palindrome: bobby
Hint: Start by removing spaces. Then check if the string equals itself in reverse.
Run
main.py
1
2
Open new tab
Dock
History
Tutorial