Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how can I do this with python This assignment will determine if the string text entered is a Palindrome, a word or sentence that is
how can I do this with python
This assignment will determine if the string text entered is a Palindrome, a word or sentence that is the same backwards as well as forwards The application will 1. 2. 3. 4. 5. Allow the user to enter string text from the keyboard by the user Read in that string text and reverse the string Check to see if it is identical to the original string Display a message that tells the user if the string is a Palindrome or not Use a while loop to keep running the application as long as the user wants to continue to test for Palindromes The basic logic . Store the input string into a variable . Count the number of characters in that string Create a "reverse" string by using a "decrementing" for loop. Python numbers each position in the string from zero to N 1 where N is the number of characters in the string (if the string had 10 characters, it numbers 0 to 9). We are going to "build" a reverse string Use an IF statement to determine if the original string and the reversed string are equivalent. Display a message saying that it is a Palindrome or is not a Palindrome Examples of Palindromes include 1. step on no pets 2. no devil lived on 3. Single words such as: bob, racecar, nun, deed, radar, madam, rotor, 4. rats live on no evil star 5. straw warts Lab Assignment 5 Is is a Palindrome? Lower and Upper case are different Enter A String to see if it is a Palindrome: Able was i ere I saw Elba "Able was i ere I saw Elba" in reverse is "ablE was I ere i saw elbA" "Able was i ere I saw Elba" is NOT identical to "ablE was I ere i saw elbA" It is NOT a Palindrome! Another Palindrome? (y or n): y Enter A String to see if it is a Palindrome: Not a Palidrome "Not a Palidrome" in reverse is "emordilaP a toN" "Not a Palidrome" is NOT identical to "emordilaP a toN" It is NOT a Palindrome! Another Palindrome? (y or n)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started