Skip to content

Commit

Permalink
Adding addition
Browse files Browse the repository at this point in the history
  • Loading branch information
bmm21002 committed Feb 12, 2025
1 parent 104a939 commit 25a2776
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions hw01/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def add(x,y):
return x+y


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

x = float(input("1. Enter number: "))
y = float(input("2. Enter number: "))

if operation == "+":
print(add(x,y))


if __name__ == "__main__":
calc()

0 comments on commit 25a2776

Please sign in to comment.