-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings.py
More file actions
39 lines (28 loc) · 879 Bytes
/
strings.py
File metadata and controls
39 lines (28 loc) · 879 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
37
##first_name = "Clovis"
##last_name = "Bagwell"
##
##full_name = first_name + ' ' + last_name
##
##print(full_name)
##first_name = input('Enter your first name: ')
##
##last_name = input('Enter your last name: ')
##
##print('Hello', first_name, last_name)
##
# nested function
##hours = int(input('How nany hours did you work? '))
##pay_rate = float(input('What is your hourly pay rate? '))
##pay = hours * pay_rate
##
##print('Your pay is' , pay)
# This program gets and item's original price and
# calculates its sale price, with a 20% discount.
# Get the item's original price
original_price = float(input("Enter the item's original price: "))
# Calculate the amunt of the discount
discount = original_price * 0.2
#Calculate the new price with discount
sale_price = original_price - discount
# Display the item's sale price
print("The sale price is" , sale_price)