+ 3
Need help
How can I complete the iteration seats = 100 seats > 0: print("Sell ticket") = seats - 1
7 Respostas
+ 5
seats = 100
while seats > 0:
print("Sell ticket")
seats = seats - 1
This loop will continue selling tickets as long as there are seats available (seats > 0). Inside the loop, it prints "Sell ticket" and decrements the seats variable by 1 with each iteration. The loop will exit when there are no more seats left.
+ 6
Your question seems vague.
Whatever you trying to solve there might be more description on what you need to use ? Like if-else, for loop?
+ 6
Your question is more a case of how to START iteration at this stage.
I recommend revisiting the lesson in Introduction to Python > Control Flow > While Loops which holds the course notes for your exact question and see if that helps, that lesson explains the solution.
+ 4
@Zahed Shaikh
or
for i <= range(100):
print("Sell ticket")
easy bro
+ 2
Seats = 100
While Seats > 0:
Print ("Sell ticket")
Seats -=1
+ 2
seats = 100
while seats > 0:
print("Sell ticket")
seats -= 1
+ 1
You Can Loop Like Now this :::::
seats = 100
while seats > 0:
print("Sell ticket")
seats -= 1