Questions & Answers
4.1.4: Fix This Program ✔️Correct Ans-brought_food = True
brought_drink = False
print(brought_food)
print(brought_drink)
# These lines don't work! Fix them so that they do.
print(type ("Did the person bring food? " + str(brought_food)))
print(type ("Did the person bring a drink? " + str(brought_drink)))
4.1.5: Plants ✔️Correct Ans-needs_water = True
needs_to_be_repotted = False
print("Needs water: " + str(needs_water))
print (str(needs_to_be_repotted))
print(needs_water)
4.2.5: Fix This Program ✔️Correct Ans-can_juggle = True
# The code below has problems. See if
# you can fix them!
if can_juggle:
print("I can juggle!")
, else:
print("I can't juggle.")
4.2.6: Is It Raining? ✔️Correct Ans-
4.3.6: Old Enough to Vote? ✔️Correct Ans-your_age = int(input("How old are you?: "))
age_requirement= 18
can_vote = your_age >= age_requirement
if can_vote:
print("old enough to vote")
else:
print("not old enough to vote")
4.3.7: Positive, Zero, or Negetive ✔️Correct Ans-random_number = int(input("Enter a number:
"))
if random_number < 0:
print("That number is negative!")
elif random_number > 0:
print("That number is positive!")
else:
print("That number is zero!")