[Python] Not operator not doing expected [duplicate]

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

  1. Stack

    Stack Membro Participativo

    I was making a simple calculator from just a test of my skills, and I put a not infront of my contain stuff, but when i run it, even if it contains only numbers, it still returns an error!

    i tried this:

    if not "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "0" in number1 or number2:
    print("Error! One of the numbers is not an number!")
    quit()

    Continue reading...

Compartilhe esta Página