Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Program Question 2: Palindrome Name your program as LastName_FirstName_A3Q2.py Palindrome is a text, number or String that when reversed results in the same word

Python Program

Question 2: Palindrome Name your program as LastName_FirstName_A3Q2.py

Palindrome is a text, number or String that when reversed results in the same word or phrase. Right a python program that will take a string or a number as in put and find out if the string is a palindrome or not.

Variables to be declared are:

Word: variable that will save the user input of the String. revWord: variable that will store the reverse of the String word.

Input: the String word will be taken in as an input form the user. Output: The program will print notification word is a palindrome otherwise word is NOT a palindrome!

Other requirements: Make use of for or while loop to reverse the word and save it to revWord. Make use of if statement to compare the two strings and print the result. The program should consider cases. E.g. Civic and Hannah are palindromes even though first letter is capital C and H respectively.

Enter the phrase for palindrome verification: Hannah Hannah is a palindrome!

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago