Learning-cicle/sami/learn-python-the-hard-way/calc.py

18 lines
396 B
Python
Raw Permalink Normal View History

2020-06-01 14:58:46 +00:00
# This function adds two numbers
def add(num1, num2):
return num1 + num2
file = open("output.txt","a")
file.write(f's
# Take input from the user
select = int(input("Select operations form 1, 2, 3, 4 :"))
number_1 = int(input("Enter first number: "))
number_2 = int(input("Enter second number: "))
print(number_1, "+", number_2, "=",
add(number_1, number_2))