โ“ ๐Ÿž๏ธ South Park Adventures ๐Ÿงข๐ŸŒฒ

# 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("3_southpark_q", "week_4", "readings", assignment_points = 15.0, assignment_tag = 'week4-readings')

# Initialize Otter
import otter
grader = otter.Notebook("3_southpark_q.ipynb")

โ“ ๐Ÿž๏ธ South Park Adventures ๐Ÿงข๐ŸŒฒ#

southpark

# Run this block of code by pressing Shift + Enter to display the question
from questions._3_southpark_q import Question1
Question1().show()
# Run this block of code by pressing Shift + Enter to display the question
from questions._3_southpark_q import Question2
Question2().show()
# Run this block of code by pressing Shift + Enter to display the question
from questions._3_southpark_q import Question3
Question3().show()

Cartmanโ€™s Decision#

cartman

Instructions:#

Write a Python program where Cartman decides whether to skip school or go to class. Use the following conditions:

  • Cartman skips school if itโ€™s snowing OR itโ€™s a weekend.

  • Otherwise, he goes to class.

Your solution must include:

  1. A function cartman_decision(is_snowing, is_weekend) (we have provided the function for you) that:

    • Takes two boolean arguments is_snowing and is_weekend.

    • Returns "Skip School" if Cartman skips school.

    • Returns "Go to Class" otherwise.

  2. Test cases to validate the correctness of your implementation. We have provided this for you as well.

# Define the function
def cartman_decision(is_snowing, is_weekend):
    # Use if-else statements to determine Cartman's decision
    ...

# Test the function
print(cartman_decision(True, False))  # Expect "Skip School"
print(cartman_decision(False, True))  # Expect "Skip School"
print(cartman_decision(False, False))  # Expect "Go to Class"
grader.check("SouthPark-CartmanDecision")

Side Note ๐Ÿ“#

Prof. Agar got suspended from middle school for wearing a Mr. Hankey shirt to class. ๐Ÿคฃ

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("week4-readings", "3_southpark_q")