CS50 Python , Nutrition Facts Table
![]() |
| The break statement - Stuck in a loop |
If you're taking PCAP - Programming Essentials In Python , you may have encountered this question in 3.2.1.9 LAB: The break statement - Stuck in a loop.
The break statement is used to exit/terminate a loop.
Design a program that uses a while loop and continuously asks the user to enter a word unless the user enters "chupacabra" as the secret exit word, in which case the message "You've successfully left the loop." should be printed to the screen, and the loop should terminate.
Don't print any of the words entered by the user. Use the concept of conditional execution and the break statement.
As the exercise asks, you need to include the keyword (break)
=================================================================================
Comments
Post a Comment
Your opinion matters, your voice makes us proud and happy. Your words are our motivation.