-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc.py
102 lines (90 loc) · 2.15 KB
/
calc.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
global textperm
textperm = "True"
def sleep(arg):
import time
time.sleep(arg)
def clear():
import os
os.system("cls")
def sum(sum1, sum2):
sum3 = sum1 + sum2
if textperm == "True":
print(sum3)
def less(less1, less2):
less3 = less1 - less2
if textperm == "True":
print(less3)
def multiply(multiply1, multiply2):
multiply3 = multiply1 * multiply2
if textperm == "True":
print(multiply3)
def divide(divide1, divide2):
divide3 = divide1 / divide2
if textperm == "True":
print(divide3)
def loading_anim():
clear()
print("Loading")
sleep(0.2)
clear()
print("Loading.")
sleep(0.2)
clear()
print("Loading..")
sleep(0.2)
clear()
print("Loading...")
sleep(0.2)
clear()
print("Loading")
sleep(0.2)
clear()
print("Loading.")
sleep(0.2)
clear()
print("Loading..")
sleep(0.2)
clear()
print("Loading...")
sleep(0.2)
clear()
def calculator():
loading_anim()
print("Calculator by VariaCode")
sleep(0.5)
print("[1] Sum")
sleep(0.5)
print("[2] Less")
sleep(0.5)
print("[3] Multiply")
sleep(0.5)
print("[4] Divide")
sleep(0.5)
option = int(input(">>> "))
while True:
if option == 1:
textperm = True
u = int(input("Input first number "))
i = int(input("Input second number "))
sum(u, i)
textperm = False
if option == 2:
textperm = True
u = int(input("Input first number "))
i = int(input("Input second number "))
less(u, i)
textperm = False
if option == 3:
textperm = True
u = int(input("Input first number "))
i = int(input("Input second number "))
multiply(u, i)
textperm = False
if option == 3:
textperm = True
u = int(input("Input first number "))
i = int(input("Input second number "))
divide(u, i)
textperm = False
if option == 69 or option == 420 or option > 7 or option < 68:
break