...

/

Solution: Break the Loop

Solution: Break the Loop

We'll cover the following...

This program keeps a conversation going until the user says "bye". It also ignores empty input.

C++
while True:
word = input("Say something: ")
if word == "bye":
break
if word == "":
continue
print("You said:", word)
  • ...