Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions