-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.py
More file actions
29 lines (20 loc) · 696 Bytes
/
math.py
File metadata and controls
29 lines (20 loc) · 696 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
#In python you can complete mathimatical calculations using Python Math Operators
#Assign a value to the salary variable
salary = 2500.00
#Assign a value to the bonus variable.
bonus = 1200.0
#Calculate the total pay by adding the salary and the bonus together
pay = salary + bonus
#Display the information
#print('Your salary is ', salary)
#print('Your bonus is ', bonus)
#print('Your pay is ', pay)
#Purchasing an item
#First, get the original price
original_price = float(input("Enter the item's original price: "))
#The discount
discount = original_price * 0.2
#The sale price
sale_price = original_price - discount
#Show the discounted price
print('The sale price is ', sale_price)