-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimple Calculator.py
More file actions
23 lines (23 loc) · 948 Bytes
/
Copy pathSimple Calculator.py
File metadata and controls
23 lines (23 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
print("\t\t==========================================================\t")
print("\t\t A Simple Calculator \t")
print("\t\t==========================================================\t")
f_no = float(input("\t\t Please Enter the first Number : \t"))
s_no = float(input("\t\t Please Enter the second Number : \t"))
print("\t\t==========================================================\t")
fnxn = input("\t\t Please enter the desired function to be performed : \t")
print("\t\t==========================================================\t")
if fnxn == "+":
a = (f_no + s_no)
print("\t\t The answer is = " , a)
if fnxn == "-":
a = (f_no - s_no)
print("\t\t The answer is = " , a)
if fnxn == "*":
a = (f_no * s_no)
print("\t\t The answer is = " , a)
if fnxn == "/":
a = (f_no / s_no)
print("\t\t The answer is = " , a)
if fnxn == "%":
a = (f_no / s_no * 100)
print("\t\t The answer is = " , a)