So I want to make a program in python 3. I have a loop, and noticed that I wanted to put a break function break
to exit an inner loop. I don't want to exit the outer loop however, and want to know what it does.
(I'm making hangman, the word guessing game. I also know my code currently sucks.)
while True:
letter = input("Choose a letter! ").strip().lower()
for i in myword: #myword is a random word generated earlier.
if i == "letter":
message = f"You found the letter {i}"
Can someone help explain what the break will do?
I changed it so that break
doesn't have brackets.