-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (30 loc) · 1.01 KB
/
main.py
File metadata and controls
33 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import time
print("Made with love by vailen")
first = float(input("Please enter the first number: "))
second = float(input("Please enter the second number: "))
chose = input("Please enter which operation do you want (addition, subtraction, multiplication, or division).: ")
if chose.lower() == "addition":
result1 = first + second
print("Calculating...")
time.sleep(3)
print(f"The result is : {result1}")
elif chose.lower() == "subtraction":
result2 = first - second
print("Calculating...")
time.sleep(3)
print(f"The result is : {result2}")
elif chose.lower() == "multiplication":
result3 = first * second
print("Calculating...")
time.sleep(3)
print(f"The result is : {result3}")
elif chose.lower() == "division":
if second == 0:
print("Error, You can't divide by 0")
exit()
result4 = first / second
print("Calculating...")
time.sleep(3)
print(f"The result is : {result4}")
else:
print("Hmm, maybe there is a typo! please select from above")