Operations Between Numbers
Дайте идея защо първият ми тест гърми :?
N1 = int(input()) N2 = int(input()) operator = str(input()) result = 0 if operator == "+": result = N1 + N2 elif operator == "-": result = N1 - N2 elif operator == "*": result = N1 * N2 elif operator == "/" and N2 != 0: result = round((N1 / N2),2) elif operator == "%" and N2 != 0: result = N1 % N2 if operator == "%" or operator == "/": if N2 == 0: print(f"Cannot divide {N1} by zero") elif operator == "/": print(f"{N1} / {N2} = {result}") elif operator == "%": print(f"{N1} % {N2} = {result}") elif operator == "+" or operator == "-" or operator == "*": if result % 2 == 0: print(f"{N1} {operator} {N2} = {result} - even") else: print(f"{N1} {operator} {N2} = {result} - odd")