

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


4.2.6: Can You Graduate? - ANS# Enter your code here has_enough_units = True has_met_requirements = True can_graduate= has_enough_units and has_met_requirements print("Can you graduate? " + str(can_graduate)) 4.3.5: Rolling Dice - ANS# Enter your code here first_die = int(input("What was the value on the first die? ")) second_die = int(input("What was the value on the second die? ")) rolled_doubles = first_die == second_die print("The value on the first die is " + str(first_die )) print("The value on the second die is " + str(second_die)) print("Rolled doubles? " + str(rolled_doubles)) 4.4.7: Teenagers - ANS# Enter your code here age = int(input("What is your age? ")) if age >= 13 and age <= 19: print("Yes, you are a teenager.")
else: print("No, you are not a teenager.") 4.5.4 Growing Circle - ANS# Start coding here. Don't forget to click the canvas
radius = 100 def key_down(event): if event.key == "ArrowLeft": circle.get_radius(radius - 10) if event.key == "ArrowRight": circle.set_radius(radius + 10) circle = Circle(100) circle.set_position(250,250) add(circle) add_key_down_handler(key_down) 4.6.4: Meme Text Generator - ANS# Enter your code here for i in range(50): print("Takes one political science class. Knows how to solve the world's problems.") 4.7.5: Count By Sevens - ANS# Enter your code here for i in range(0,500,7): print(i)