18. Change it up


#1



Code is not incorrect but from what I see from other postings I can use an elif statement if I do not want tomato printed. My question is for this lesson is that what it is asking for? It just asks us to allow the else statement to execute, that leaves it up to the user to interpret. We could simply delete all the if statement. We could add an elif statement as suggested. We could get rid of the break. I have done this by replacing break with continue. That way it still runs the if statement and continues through my loop instead of exiting. I guess what I am asking is does it matter which route we choose. I still did what the problem asks, I just see that there is a lot of room for your own interpretation here.


Replace this line with your code.


#2

here is my code, but it doesn't work

please help me


#3

It says in the comment that your else statement is not executed.
Just remove indentation from else statement and adapt for the print statement.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.