[Python] TypeError not supported between instances of 'type' and 'int'

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to make matrix 2 dimension and then I took 1 of the matrix's element into comparison. for the record, i declare my matrix with type integer and I do comparison with integer too. what happen with this ? this is my matrix declaration :

    Matkul = [str]*10
    for i in range (10) :
    Matkul = [int]*2


    then this is my comparison between integer element in matkul with integer :

    x = Matkul[1]
    if x >= 85 :
    return 'A'

    Continue reading...

Compartilhe esta Página