Question: 6 . You are going to add some additional functionality to this program. To do this you will need to understand what each line of

6. You are going to add some additional functionality to this program. To do this you will need to understand what each line of code does in the solution program above. Here is where you should make your changes:
```
Solution to programming challenge for Learning python course
LinkedIn Learninf: Pytion course by Joe Marlini
~)
8 DO NOT CHANGE THE CODE %OELOW THIS L.TNE
def is_palindrome(testistr):
* use the plice titick to reverse the string
```
```
return of
return
run = True
S DO HOT CMANGE THE CODE REOVE THIS LTNEE
A) WRITE YOUR CODE HERE TO GET userLSme
\ while (run):
: DO NOT CHANGE THE CODE BELOW THIS LIME
teststr = imput("Enter'string to test for palindrome or 'exit':A")
A If the user types "extt" then quit the program
if teststr == "exit":
run = False
break
A convert the strirug to DO NOT CHANGE
teststr = teststr.lower()
% strip all the spaces and punctuation from the string
newstr =""
for x in teststr:
if x.isalnum():
newstr += x
& DO HOT CHANGE THE CODE &BOVE THIS LINE
print("patindrome testt:", is_palindrome(newstr))
B) REPLACE THIS LINEWMTH YOUR IF...ELSE
```
a. Request the username (use an input statement on line 12). Let's say their name is "Suzy"
b. Test if newstr is a palindrome. We are replacing line 30.
i. If true, print: "Suzy, teststr is a palindrome!"
ii. else, print: "Suzy, teststr is NOT a palindrome!"
iii. sample If...Else
```
if (test):
do this
else:
do this instead
```
c. Here is what your output should look like
C:IWINDOWSIpy.exe
```
Hello, what is your nane? Suzy
Enter string to test for palindrome or 'exit': racecar
Suzy racecar is a palindrome!
Enter string to test for palindrome or 'exit': DePaul
suzy depaul is NOT a palindrome!
```
d. Submit your completed program to D2L Submissions in the HW3 folder.
e. Your file name should have the format:
1. LastName_FirstName_HW3.py
6 . You are going to add some additional

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 Programming Questions!