-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalculator.py
More file actions
36 lines (29 loc) · 824 Bytes
/
Calculator.py
File metadata and controls
36 lines (29 loc) · 824 Bytes
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
print('Basic Python-Based Calculator') #Intro
print('Developed By delorean')
print('~')
print('Select Operation')
print('1. +')
print('2. -')
print('3. *')
print('4. /')
print('~')
operation = input() #Defines the mathematical operation type
print('Enter First Number')
num1 = float(input()) #First number in equation
print('Enter Second Number')
num2 = float(input()) #Second number in equation
if operation == '1': #Addition
print('Output')
print(num1 + num2)
elif operation == '2': #Subtraction
print('Output')
print(num1 - num2)
elif operation == '3': #Multiplication
print('Output')
print(num1 * num2)
elif operation == '4': #Division
print('Output')
print(num1 / num2)
else:
print('Invalid Operation - Please Restart Script') #Invalid operation error message
input()