Sfoglia il codice sorgente

Add 'calculator.py'

pull/1/head
mctastic 3 anni fa
parent
commit
f528e2a474
1 ha cambiato i file con 26 aggiunte e 0 eliminazioni
  1. +26
    -0
      calculator.py

+ 26
- 0
calculator.py Vedi File

@@ -0,0 +1,26 @@
#!/usr/bin/python3

def add(x, y):
return x + y


def main():
x = int(input("Input x: "))
y = int(input("Input y: "))

# returns x + y
addition = add(x, y)
print(addition)

# sub(x, y) returns x - y

# mult(x, y) returns x * y

# div(x, y) returns x // y

# mod(x, y) returns x % y

# expo(x, y) returns x ** y

if __name__ == "__main__":
main()

Caricamento…
Annulla
Salva