Lab 1
Lab 1
You must get checked out by your lab CA prior to leaving early. If you leave without being
checked out, you will receive 0 credits for the lab.
Restrictions
The Python structures that you use in this lab should be restricted to those you have learned in
lecture so far. Please check with your course assistants in case you are unsure whether
something is or is not allowed!
If you do not have Python running on your computer please go back to Lab 0 and set it up
before moving on
For Problem 1, write your answers on paper or in a text editor on your computer.
1. INCHES_IN_ONE_FOOT = 12
2. anotherVariable = 16.5
3. fEET_iN_oNE_mILE = “five thousand two hundred and eighty feet”
4. THINGS_MORE_FUN_THAN_LAB = 0
5. descriptive_variable_name = True
Part 1B: Data Types:
State the data type for each variable shown in Part 1A.
You have been wanting to bake scones and have found a recipe, but the recipe uses the metric
system and you only have measuring cups. Let's convert the metric measures to customary
measurements.
75 g salted butter
350 g flour
150 ml milk
Your program should take user input for the number of scones they want to make and print the
quantity of each ingredient in customary measurements.
Your code should output the following (disregard small floating point differences):
Enter the number of scones you want to make: 25
To make 25 scones use 0.8333333333333334 cups butter,
5.833333333333333 cups flour, and 1.875 cups milk
1. Take user input for number of ice cream scoops, radius of the ice cream cone, and height of
the ice cream cone.
2. Calculate and print the total volume of the ice cream cone. Use 3.1416 as an
approximation for PI.
We will be assuming we have perfectly spherical ice cream scoops and a perfect ice cream
cone!
The formula for sphere volume is as follows and will be used for each ice cream scoop:
The formula for cone volume is as follows and will be used for the ice cream cone:
This program will ask the user for four inputs: a number of days, number of hours, number of
minutes, and number of seconds. This may look something like:
Hint: Use div and mod. Do not use conditionals to solve the problem