I am trying to implement a program where I want to check against the criteria that once the limit of number of tables or chairs is reached, the loop should break and print the final print statement. Logically after the first break statement, it breaks from the first for loop but it does not break the complete for loop and print the final statement and keeps iterating.
I want that ones the max number of tables or chairs is reached, the loop should break.
Any idea how to modify? Can I implement while statement, if so - how?
I am new to python and find these exercises interesting and your help will be great.
#variables
number_of_tables = 200
no_of_chairs = 500
for tables in range(0, number_of_tables):
for chairs in range(0, no_of_chairs):
prompt = "Bienvenue a la'restaurant"
answer = input("Please enter for how many people you need a table: ")
print(f"Welcome family of {answer}, please wait while we take you to your seat")
number_of_tables -= 1
no_of_chairs -= int(answer)
if number_of_tables == 0 or no_of_chairs == 0:
reply = "Good things need patience. We are full. Please wait in the lobby till a table gets empty. We thank you for understanding"
print(reply)
break;
print("Thank you for visiting us.")