Flag in python.

Suppose there are many condition to check in a game. The conditions which stops the game. So we can do with while loop. But it becomes complex for while loop. so, python uses flag . Flag check if current position is true and many condition are true in game . So, python gives that program is active . Basically flag represent the all condition result.

https://stackoverflow.com/questions/59120347/what-is-a-flag-in-python-while-loops#:~:text=A%20flag%20in%20Python%20acts,of%20event%20makes%20it%20False.

prompt = "\nplease
enter the
message: "
prompt+="\nplease
tell me
something
about you: "

# game is currently
# active
active = True
while active:
a = input(prompt)

if a == "quit":
active = False
else:
print(a)

Output:
please enter the message:
please tell me something
about you:vipul
vipul


please enter the message:
please tell me something
about you:aman
aman


please enter the message:
please tell me something
about you:quit

# The player quit
# the game.