diff --git a/hw01/main.py b/hw01/main.py index 64ace1a..8737e8c 100644 --- a/hw01/main.py +++ b/hw01/main.py @@ -7,10 +7,13 @@ def sub(x,y): def mult(x,y): return x*y +def div(x,y): + return x/y + def calc(): while(True): - operation = input("Enter operation from [+,-,*]: ") - if operation =="+" or operation == "-" or operation == "*": + operation = input("Enter operation from [+,-,*,/]: ") + if operation =="+" or operation == "-" or operation == "*" or operation == "/": break print("Enter valid operation") @@ -26,6 +29,8 @@ def calc(): if operation == "*": print(mult(x,y)) + if operation == "/": + print(div(x,y)) if __name__ == "__main__": calc() \ No newline at end of file