Question: Write a Python program to read in a number of strings from the user. Stop when the user enters Done. Then check if each of

Write a Python program to read in a number of strings from the user. Stop when the user enters Done. Then check if each of the strings is a palindrome (ignore case and spaces) and throw the palindromic strings into a dictionary, where the key is a counter and the value is the string. Finally, print the dictionary. You can assume that your strings will only contain lower and uppercase letters and spaces

Sample Run:

Enter the strings:

taco cat

swap paws

Who are you people?

Wumbology

Rats live on no evil star

Done

The palindromes are: {1: taco cat, 2: swap paws, 3: Rats live on no evil star}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!