Question: In this exercise, we will perform simple operations on strings. 1 . First the program asks for two words. Then, it compares these words according
In this exercise, we will perform simple operations on strings.
First the program asks for two words. Then, it compares these words according to the string
comparison operation and prints the stings according to the order see example runs If the
words are the same, print: The words are the same. Remember that strings are compared in
Python using the same operators as numbers.
After this, your program should test whether the given words contain the character z If the
letter z is found in either of the words or both! the program outputs: "The contains
z If the letter is not found, the program prints: "The letter z was not found in either of the
words."
Finally, your program should ask for a third string and determine whether it is a palindrome.
Palindrome is a word that can be read in the same way from beginning to end as from end to
beginning. If the given word is palindrome, print "The is a palindrome." If not, print
"The is not a palindrome.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
