1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How to use many ands or ors in an if statement [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I am making a basic calculator and trying to make this Python code work, it only prioritizes the final if or the first or:

    def get_values():
    global value1, value2, opperation
    while opperation != ("+" or "-" or "*" or "/" or "//"):
    value1 = int(input("input value 1:"))
    opperation = str(input("the opperator +, -, *, / , or // aka no remainders:"))
    value2 = int(input("input value 2:"))
    print(opperation)



    Tried using many ors or ands with () in the if but it just won't work.

    Continue reading...

Compartilhe esta Página