0

seats = 10# initial number of seats while seats > 0: # seat available? print("Sell ticket") # ticket sold seats = seats - 1

Explain it to me..

5th Jun 2023, 4:31 AM
Sujay Chatterjee
1 Odpowiedź
+ 4
inital number of seat is '10' while seats>0: (which means 10>0) Now, if seat available then print 'sell ticket' and then decrement of seat, means seats=seats -1 (which means 10-1=9) Now, again same process while seats>0: (which means 9>0)....
5th Jun 2023, 4:58 AM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar