Im having this problem: TypeError: object of type 'bool' has no len()

Viewed 40

so im getting the error, can someone help me with this...

asientos = [
    [1, 2],
    [3, 4],
    [5, 6],
    [7, 8],
    [9, 10]
]

for i in range(0,10):
    asientos.append(False)
while True:
    print("1. Elija su asiento")
    opc = int(input("Ingrese opción"))

    if opc == 1:
        print("Los asientos disponibles son")
        num_filas =  len(asientos)
        for fila in range(0, num_filas):
            for columna in range(0, len(asientos[fila])):
                print(asientos[fila][columna], end = " ")
            print()
            if asientos[1] == False: #El asiento esta libre 
                print(i+1)
        numero_asientos = int(input("Que asiento quiere elegir"))
        posicion = numero_asientos - 1 
        if posicion >= 0 and posicion <= 5:
            
            if asientos[posicion] == False:
                asientos[posicion] == True
                print("El asiento elegido es:", numero_asientos) 
            else:
                print("El asiento esta ocupado")
        else:
            print("Ingrese los valores permitidos")
    else:
        print("Opción ingresada incorrecta")
        
    seguir = input("Desea volver a ejecutar el programa: (Si - No)").lower().strip()
    if seguir != "si":
        break

Im new with python.. so i don't know what im doing wrong in this case. If someone can explain what i cand do in this case i would appreciate

0 Answers
Related