Skip to content

Commit f233a09

Browse files
committed
10/13
1 parent ec66b33 commit f233a09

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

__pycache__/ex10.cpython-310.pyc

502 Bytes
Binary file not shown.

ex10.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
def calculator():
2+
num1 = input("Enter number 1: ")
3+
num2 = input("Enter number 2: ")
4+
oprn = input("Enter operation (+, *, /, -): ")
5+
6+
if oprn == "+":
7+
return int(num1)+int(num2)
8+
elif oprn == "*":
9+
return int(num1)*int(num2)
10+
elif oprn == "/":
11+
return float(int(num1)/int(num2))
12+
elif oprn == "-":
13+
return int(num1)-int(num2)
14+
15+
16+

main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from ex1 import hello_world
2+
from ex10 import calculator
23
from ex2 import array_to_string
34

45
# ex1
@@ -54,6 +55,11 @@
5455
# ex9
5556
from ex9 import vowel_counter
5657

57-
sentence = "This is a test"
58-
num_vowels = vowel_counter(sentence)
59-
print(num_vowels)
58+
# sentence = "This is a test"
59+
# num_vowels = vowel_counter(sentence)
60+
# print(num_vowels)
61+
62+
# ex10
63+
while True:
64+
result = calculator()
65+
print(result)

0 commit comments

Comments
 (0)