Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

CODEHS Python Chapter 4 Exam | Questions with Correct Answers| Verified

Document preview thumbnail
Preview 2 out of 8 pages

CODEHS Python Chapter 4 Exam | Questions with Correct Answers| Verified

Content preview

CODEHS Python Chapter 4 Exam | Questions with Correct Answers|
Verified
4.1.4: Do You Have a Cat? - Answer"""

This program should declare a boolean that describes whether or

not you have a cat. Then you should print out an informative

message to the user.

"""



have_car = True

print("Do you have a cat? " + str(have_car))



4.2.6: Can You Graduate? - Answer# Enter your code here

has_enough_units = True

has_met_requirements = False

can_graduate = has_enough_units and has_met_requirements

print("Can graduate? " + str(can_graduate))



4.2.7: School's Out - Answer# Enter your code here

is_weekday = False

is_holiday = True

is_weekend = True

no_school_today = is_weekend or is_holiday

not no_school_today

print("There is school today? " + str(no_school_today))



4.3.5: Rolling Dice - Answer# Enter your code here

first_die = int(input("What did you roll on your first die? "))

print(first_die)

, second_die = int(input("What did you roll on your second die? "))

print(second_die)

rolled_doubles = first_die == second_die

print("Rolled doubles: " + str(rolled_doubles))



4.3.6: All Star - Answerpoints = int(input("How many points per game do you score? "))

rebounds = int(input("How many rebounds per game do you get? "))

assists = int(input("How many assists per game do you get? "))

all_star = points >= 25 or points >= 10 and rebounds >= 10 and assists >= 10

print("Is all star? " + str(all_star))



4.4.7: Teenagers - Answer# Enter your code here

age = int(input("What is your age? "))

teenager = age >= 13 and age <= 19

if teenager:

print("Yes, you are a teenager.")

else:

print("No, you are not a teenager.")



4.4.8: Meal Planner - Answer# Enter your code here

meal = input("What meal do you want. Breakfast, lunch, or dinner? ")

if meal == "breakfast":

print("Have some pancakes")

elif meal == "lunch":

print("Have a sandwich")

elif meal == "dinner":

print("Have a steak")



4.5.4: Growing Circle - Answer# Start coding here. Don't forget to click the canvas

Document information

Uploaded on
February 26, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
3
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions