Question: I have been stuck on a problem for 2 days. This is using vocareum software for python where we all have different questions. I was

I have been stuck on a problem for 2 days. This is using vocareum software for python where we all have different questions. I was able to get it to pass tests 1-4 before it stops at test 5. I can see why it is not passing as I need to uppercase the letter "i" in certain areas. I am just unsure how to code this to make it work without altering the previous ones.

quote = input("Please enter a paragraph: ")

print(quote)

quote = quote.lower()

word = input("Please enter a common word: ")

print(word)

word = word.lower()

where = quote.find(word)

failsafe = 30

while where >= 0:

print("Found " + word + " at position "+ str(where))

left = quote[:where]

right = quote[where+len(word):]

quote = left + word.upper() + right

print(quote)

where = quote.find(word)

failsafe = failsafe - 1

if failsafe <= 0:

break

0001:Please~enter~a~paragraph:~Don't~worry~about~the~world~ending~today,~it's~already~tomorrow~in~Australia~You~can~have~peace,~or~you~can~have~freedom.~Don't~ever~count~on~hav

ing~both~at~once.~I~loathe~people~who~keep~dogs.~They~are~cowards~who~haven't~got~the~guts~to~bite~people~themselves.'~-August~Strindberg~If~it~weren't~for~the~last~minute,~noth

ing~would~get~done.

0002:Please~enter~a~common~word:~I

0003:Found~i~at~position~31

===================MISMATCHFOUNDONLINE0003:===================

ACTUAL:Found~i~at~position~31

EXPECTED:[NONE]

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!