Code HS Intro to Computer Science Ex 4.5.4:Correct Portion
# 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
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? "))
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!"
Thanks and Peace
Tags:
Code HS, Code HS Tracy Python, Code HS Answers, COde HS Tracy Python Answers,
0 Yorumlar