-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_types_and_variables.py
51 lines (32 loc) · 1.5 KB
/
data_types_and_variables.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
# You have rented some movies for your kids: The little mermaid (for 3 days),
# Brother Bear (for 5 days, they love it), and Hercules (1 day, you don't know yet if they're going to like it).
# If price for a movie per day is 3 dollars, how much will you have to pay?
little_mermaid = 3;
brother_bear = 5;
hercules = 1;
cost_per_day = 3.00;
total_cost = (little_mermaid * cost_per_day) + (brother_bear * cost_per_day) + (hercules * cost_per_day);
print (total_cost);
# Suppose you're working as a contractor for 3 companies: Google, Amazon and Facebook, they pay you a different rate per hour.
# Google pays 400 dollars per hour, Amazon 380, and Facebook 350. How much will you receive in payment for this week?
# You worked 10 hours for Facebook, 6 hours for Google and 4 hours for Amazon.
amazon_ph = 380
google_ph = 400
facebook_ph = 350
a_hours = 4
g_hours = 6
f_hours = 10
total_pay = (amazon_ph * a_hours) +(google_ph * g_hours) + ( facebook_ph * f_hours)
print (total_pay)
# A student can be enrolled to a class only if the class
# is not full and the class schedule does not conflict with her current schedule.
class_not_full = True
class_is_full = False
student_available = True
student_unavailable = False
can_enroll = class_not_full and student_available
print(can_enroll);
# A product offer can be applied only if people buys more than 2 items, and the offer has not expired.
# Premium members do not need to buy a specific amount of products.
username = 'codeup'
password = 'notastrongpassword'