Python Using Databases in Python Our Diary App Switching It Up

Enzie Riddle
Enzie Riddle
Front End Web Development Techdegree Student 13,756 Points

Enter 'q' to quit

I'm not understanding how, when we press 'q' in the console, the app quits. I thought we'd have to create a close function?

Eduardo Valencia
Eduardo Valencia
12,433 Points

Hi. Quitting in this scenario simply means exiting the while loop, because the while loop displays the menu with the options. The condition in the while loop is that the input should not equal 'q'. When the user types in 'q', the condition evaluates to false, which stops the while loop. Therefore, the app quits because there is nothing else for the program to do.