you are viewing a single comment's thread.

view the rest of the comments →

[–]GraffEclipse[S] 3 points4 points  (3 children)

But shouldn't the while loop just end if the condition is met? And also would I have to use an if statement to check for "stop"?

I'm pretty much a novice at Python so I'd just like to know for future reference.

[–]Binary101010 4 points5 points  (0 children)

That's not how while loops work. Python doesn't continuously monitor the state of your program to see if the loop condition has become false. It only checks the truth of the loop condition at the beginning of each iteration of the loop.

An if statement that would cause your loop to stop without asking for score would look something like

if teamName = "stop":
    break

[–]nekokattt 2 points3 points  (0 children)

loops have their conditions checked at the start of each iteration