Skip to content

Commit

Permalink
Create 5.5.4 Correct Portion
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeHS-Solutions authored Jan 20, 2024
1 parent fe34dc7 commit 8e942cc
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Amount of food and number of people
tons_of_food = 0.07
num_people = 25

# Determine how much food each person gets
tons_of_food_per_person = tons_of_food / num_people
round(tons_of_food_per_person, 5)
print(tons_of_food_per_person)

# Ask the user how much food they took
tons_taken = float(input("How many tons of food did you take? "))
round(tons_taken, 5)
if round(tons_taken, 5) == round(tons_of_food_per_person, 5):
print("Good job, you took the right amount of food!")
else:
print("You took the wrong amount of food!")

0 comments on commit 8e942cc

Please sign in to comment.