Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+3 votes

The function checks if the string of envelopes is empty or if the user hits Escape, but it seems to only work with Escape. It will still show the correct win/lose screen based on if the envelopes were collected, but I have to hit "Escape" to get there. I am currently using the .remove for the envelope string.

asked in CSC201 Spring 2021 by (8 points)

1 Answer

+1 vote

if your condition for the main while loop running is that there are remaining envelopes, then it will end when they are all caught. so if an envelope is removed from the list when caught, you can use the list of envelopes being empy [ ] as a sentinel condition

answered by (8 points)