37,279 views
35 votes
35 votes
When would a flag variable be most useful?

1.when printing the number of items in a list

2.when checking the condition of a variable in a while loop

3.inside a function that prints the largest side of a triangle

4.when initializing a list

User JeroenW
by
3.0k points

1 Answer

7 votes
7 votes

2. When checking the condition of a variable in a while loop.

User Malcolm Christie
by
3.3k points