Skip to content

Commit

Permalink
Adding multiplication
Browse files Browse the repository at this point in the history
  • Loading branch information
bmm21002 committed Feb 12, 2025
1 parent d62cab3 commit 77a0afa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hw01/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ def add(x,y):
def sub(x,y):
return x-y

def mult(x,y):
return x*y

def calc():
while(True):
operation = input("Enter operation from [+,-]: ")
if operation =="+" or operation == "-":
operation = input("Enter operation from [+,-,*]: ")
if operation =="+" or operation == "-" or operation == "*":
break
print("Enter valid operation")

Expand All @@ -20,6 +23,9 @@ def calc():
if operation == "-":
print(sub(x,y))

if operation == "*":
print(mult(x,y))


if __name__ == "__main__":
calc()

0 comments on commit 77a0afa

Please sign in to comment.