Skip to content

Commit

Permalink
Merge pull request #4 from bmm21002/feature-division
Browse files Browse the repository at this point in the history
Adding division
  • Loading branch information
bmm21002 committed Feb 12, 2025
2 parents cc10ab8 + bdbade8 commit 41aa354
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hw01/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -26,6 +29,8 @@ def calc():
if operation == "*":
print(mult(x,y))

if operation == "/":
print(div(x,y))

if __name__ == "__main__":
calc()

0 comments on commit 41aa354

Please sign in to comment.