Home › Python with Chai › Lesson 10
while True: keep the shop open
Python with Chai, lesson 10 of 20. A short Hinglish video, simple English notes and code you can run, free.
Open the interactive lesson with Run button
The idea
while True means keep going forever: take an order, serve chai, next order.
break exits the loop immediately.
To close the shop, type "band". The if and break stop the loop.
The code
while True:
order = input("Order? ")
if order == "band":
break
print(order, "ready!")
print("Dukaan band! Kal milte hain.")
Output:
Order? Masala Masala ready! Order? band Dukaan band! Kal milte hain.
Try it yourself
- Add every order to a list and print all the orders when the shop closes.
- Add the try-except from Lesson 9 and also ask how many cups.
Remember
while True keeps going; break stops.
← try-except: explain, don't crash · Files: save the bill →
All lessons: Python with Chai