-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata_types_and_variables.py
More file actions
21 lines (15 loc) · 1.3 KB
/
Copy pathdata_types_and_variables.py
File metadata and controls
21 lines (15 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Create a Python script file named data_types_and_variables.py. Inside it, write some Python code, that is, variables and operators,
to describe the following scenarios. Do not worry about the real operations to get the values; the goal of these exercises is to
understand how real-world conditions can be represented with code.
1/ 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 * 3)
Brother_Bear = (5 * 3)
Hercules = (1 * 3)
2/ 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.
3/ 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.
4/ 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.
1/