I am trying to write a program for a class, that given a sold ticket, my matrix (15x30) should replace the available seat "#" by sold seat "*".
seats = []
for i in range (1,16):
for i in range (1,31):
seats.append("#")
while True:
try:
x = int(input("SVP entrer le numéro de la rangée (1-15): "))
for x in range (1,16):
y = int(input("SVP entrer le numéro du siège (1-30): "))
for y in range (1,31):
b = ((x-1) * 30) + (y-1)
s = "*"
for b in len(seats):
seats[b] = seats[s]
z = input("Voulez-vous acheter un autre sièges (o/n)? ")
if z == "o":
return True
else:
return False
except ValueError:
print("Désoler, ce siège à déjà été acheter.")
print(seats)
print("Fin du programme")
However, I have an error:
File "/Users/staceypoulet/Desktop/temp1.py", line 15, in <module>
if z in len(seats):
for b in len(seats):
TypeError: 'int' object is not iterable
Could anyone help me see the mistake? Thank you in advance to anyone who gives me the time :)