# You must make sure to run all cells in sequence using shift + enter or you might encounter errors
from pykubegrader.initialize import initialize_assignment
responses = initialize_assignment("4_skull_q", "week_2", "lecture", assignment_points = 8.0, assignment_tag = 'week2-lecture')
# Initialize Otter
import otter
grader = otter.Notebook("4_skull_q.ipynb")
โ ๐ฆด Hytrl Skull Collection Problem#
Imagine you are cataloging skull specimens in the Hytrl Skull Collection. Each skull has a unique catalog number, type (e.g., carnivore or herbivore), and weight in kilograms.
Your Task:#
Define the Variables:
Create a variable
catalog_number
and assign it a string value"HSC-101"
.Create a variable
skull_type
and assign it the string"Carnivore"
.Create a variable
weight_kg
and assign it a float value4.25
.
Format and Print Information:
Use an f-string to combine these variables into a descriptive sentence.
The output should be:
"The skull with catalog number HSC-101 is a Carnivore and weighs 4.25 kg."
Data Type Check:
Use the
type()
function to verify and print the data type of each variable (catalog_number
,skull_type
, andweight_kg
).For each variable, print a sentence like:
"The data type of catalog_number is <class 'str'>."
Comments:
For each of the steps add a comment explaining what the code is doing. We are using autograders so the comments have to match an expected schema.
The comments for each step should be:
# Define the Variables
# Format and Print Information
# Data Type Check
def skull_catalog():
# Step 1
...
# Step 2
...
# Step 3
...
# This will call the function and display the output
# Do not change the lines below
skull_catalog()
grader.check("activity-Hytrl Skull Collection")
Submitting Assignment#
Please run the following block of code using shift + enter
to submit your assignment, you should see your score.
from pykubegrader.submit.submit_assignment import submit_assignment
submit_assignment("week2-lecture", "4_skull_q")