Browse Source

Update 'calculator.py'

pull/5/head
branch 3 years ago
parent
commit
4bf47cb7d3
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      calculator.py

+ 7
- 0
calculator.py View File

@@ -12,6 +12,10 @@ def div(x,y):
def mult(x,y):
return x * y

def sub(x, y):
return x - y


def main():
x = int(input("Input x: "))
y = int(input("Input y: "))
@@ -20,7 +24,10 @@ def main():
addition = add(x, y)
print(addition)

# sub(x, y) returns x - y
subtraction = sub(x, y)
print(subtraction)

# mult(x, y) returns x * y
multiply = mult(x,y)


Loading…
Cancel
Save