-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculator #.py
51 lines (46 loc) · 1.63 KB
/
Calculator #.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
import time
import os
os.system("title Calculator #")
print(' ')
print('Welcome to Calculator #')
print(' ')
time.sleep(1)
def space():
print(' '*5)
space()
def Calculator():
os.system("cls")
operation = input('What is your operation? (*, +, /, -) >> ')
space()
if operation == '*':
times = int(input('What is your first number?>> '))
space()
times2 = int(input('What is your second number?>> '))
print('Answer:' + str(times*times2))
if operation == '+':
add = int(input('What is your first number?>> '))
space()
add2 = int(input('What is your second number?>> '))
print('Answer:' + str(add+add2))
if operation == '/':
div = int(input('What is your first number?>> '))
space()
div2 = int(input('What is your second number?>> '))
print('Answer:' + str(div/div2))
if operation == '-':
minus = int(input('What is your first number?>> '))
space()
minus2 = int(input('What is your second number?>> '))
print('Answer:' + str(minus-minus2))
space()
time.sleep(1.6)
space()
con = input('Continue? |[y]| |[n]| : ')
if con == 'y':
pass
if con == 'n':
space()
exit()
space()
while True:
Calculator()