-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.py
17 lines (11 loc) · 928 Bytes
/
calc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This is a program that acts as a calculator, it has 2 inputs: a and b.
# It outputs (prints) the four basic operations results if a an b are the inputs.
# This program is incomplete -- your goal in this session is to deliver a fully functional calculator.
# Modify this file accordingly and push it to the repo.
a = 5 # a is a variable that has a value of 5
b = 3 # b is a variable that has a value of 3
sum_result = a + b # sum_result is a variable that stores the result of doing a + b.
difference_result = a - b # difference_result is a variable that stores the result of doing a - b.
# print() is a function that will "show" whatever you tell it.
print("Sum:", sum_result) # In this case we are "telling" print() to show the string "Sum:" and the result.
print("Difference:", difference_result) # In this case we are "telling" print() to show the string "Difference:" and the result.