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.
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.