Unit 4 Code HS Python
This flashcard set features beginner-friendly programming exercises from CodeHS that focus on Boolean variables, logical operators, and conditional statements in Python. It helps students practice making decisions in code using user input, comparisons, and logical reasoning to solve simple real-world problems.
4.1.4: Do You Have a Cat? | CodeHS
"""
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_cat = False
print("Have a cat? " + str(have_cat))
Key Terms
4.1.4: Do You Have a Cat? | CodeHS
"""
This program should declare a boolean that describes whether or
not you have a cat. Then you should print out an informative
message t...
4.2.6: Can You Graduate? | CodeHS
# Enter your code here
has_enough_units = False
has_met_requirements = False
can_graduate = has_enough_units or has_met_requirements
pr...
4.2.7: School's Out | CodeHS
# Enter your code here
is_weekday = True
is_holiday = True
no_school_today = is_weekday or not is_holiday
print("There is no school tod...
4.3.5: Rolling Dice | CodeHS
# Enter your code here
dice_first=int(input("first die? "))
print(str(dice_first))
dice_second=int(input("second die? "))
print(str(dic...
4.3.6: All Star | CodeHS
# Enter your code here
points=int(input("Points per game? "))
rebounds=int(input("Rebounds per game? "))
assist=int(input("Assist per game...
4.4.7: Teenagers | CodeHS
# Enter your code here
age = int(input("What is your age? "))
if age >= 13 and age<=19:
print("Yes, you are a teenager.")
else:
Related Flashcard Decks
Study Tips
- Press F to enter focus mode for distraction-free studying
- Review cards regularly to improve retention
- Try to recall the answer before flipping the card
- Share this deck with friends to study together
Term | Definition |
---|---|
4.1.4: Do You Have a Cat? | CodeHS | """ |
4.2.6: Can You Graduate? | CodeHS | # Enter your code here |
4.2.7: School's Out | CodeHS | # Enter your code here |
4.3.5: Rolling Dice | CodeHS | # Enter your code here |
4.3.6: All Star | CodeHS | # Enter your code here |
4.4.7: Teenagers | CodeHS | # Enter your code here |
4.4.8: Meal Planner | CodeHS | # Enter your code here |
4.5.4: Growing Circle | CodeHS | # Start coding here. Don't forget to click the canvas |
4.6.4: Meme Text Generator | CodeHS | # Enter your code here |
4.6.5: The Worm | CodeHS | NUM_CIRCLES = 15 |
4.6.6: Caterpillar | CodeHS | NUM_CIRCLES = 15 |
4.7.5: Count By Sevens | CodeHS | # Enter your code here |
4.7.6: Powers of Two | CodeHS | # Enter your code here |
4.8.4: Better Sum | CodeHS | # Enter your code here |
4.8.5: Factorial | CodeHS | # Enter your code here |
4.8.6: All Dice Values | CodeHS | # Put your code here |
4.9.5: Lots of Dice | CodeHS | import random |
4.9.6: Random Color Square | CodeHS | import random |
4.10.4: Inventory | CodeHS | STARTING_ITEMS_IN_INVENTORY = 20 |
4.11.4 Snake Eyes | CodeHS | import random |
4.11.5: Better Password Prompt | CodeHS | SECRET = "abc123" |