Skip to content

Commit 0619f4f

Browse files
committed
revert to base
1 parent 9a684a9 commit 0619f4f

File tree

3 files changed

+17
-63
lines changed

3 files changed

+17
-63
lines changed

bibliotekas_3.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

calculator.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
def add(number1, number2):
2-
"""Add function."""
32
return number1 + number2
43

54
def multiplication(number1, number2):
6-
"""Multiplication function."""
75
return number1 * number2
86

7+
def division(number1, number2):
8+
return number1 / number2
9+
10+
def subtract(number1, number2):
11+
return number1 - number2
12+
13+
914
print("Select operation.")
1015
print("1. Add")
1116
print("2. Multiply")
1217
print("3. Divide")
18+
print("4. Subtract")
1319

1420
while True:
1521
# take input from the user
16-
choice = input("Enter choice(1/2): ")
22+
choice = input("Enter choice(1/2/3/4): ")
1723

18-
if choice in ('1', '2'):
24+
if choice in ('1', '2', '3', '4'):
1925
num1 = float(input("Enter first number: "))
2026
num2 = float(input("Enter second number: "))
2127

@@ -24,9 +30,14 @@ def multiplication(number1, number2):
2430

2531
elif choice == '2':
2632
print(num1, "*", num2, "=", multiplication(num1, num2))
33+
34+
elif choice == '3':
35+
print(num1, "/", num2, "=", division(num1, num2))
36+
37+
elif choice == '4':
38+
print(num1, "-", num2, "=", subtract(num1, num2))
39+
2740

28-
# check if user wants another calculation
29-
# break the while loop if answer is no
3041
next_calculation = input("Do you want to do another calculation? (yes/no): ")
3142
if next_calculation == "no":
3243
break

viminfo.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)