Output:
How Many People Are In Your Famly 2
How old... 5
[5]
What gender... Male
['Male']
How old... 10
[5, 10]
What gender... Female
['Male', 'Female']
Error:
Traceback (most recent call last):
File "C:\Users\TFish\Desktop\Python\Culminating.py", line 440, in <module>
if ages[2] > 0 <= 3 and genders[2] == "Male":
IndexError: list index out of range
#User Inputs
while True:
try:
peopleInFamly = int(input("How Many People Are In Your Famly "))
# Amount Of Weeks Do You wanna Buy Groceries For
except ValueError:
print("Invalid Input Please Try Again")
continue
else:
break
ages = []
genders = []
for x in range(peopleInFamly):
age = int(input("How old... "))
ages.append(age)
print (ages)
gender = input("What gender... ")
genders.append(gender)
print (genders)
# For 1st Person in famly
#########################################
if ages[0] > 0 <= 3 and genders[0] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 0 <= 3 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 4 <= 8 and genders[0] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 4 <= 8 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 9 <= 13 and genders[0] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 9 <= 13 and genders[0] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 14 <= 18 and genders[0] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 14 <= 18 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 19 <= 50 and genders[0] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 19 <= 50 and genders[0] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 51 <= 110 and genders[0] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 51 <= 110 and genders[0] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 2nd Person in famly
#########################################
if ages[1] > 0 <= 3 and genders[1] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 0 <= 3 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 4 <= 8 and genders[1] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 4 <= 8 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 9 <= 13 and genders[1] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 9 <= 13 and genders[1] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 14 <= 18 and genders[1] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 14 <= 18 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 19 <= 50 and genders[1] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 19 <= 50 and genders[1] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 51 <= 110 and genders[1] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 51 <= 110 and genders[1] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 3rd Person in famly
#########################################
if ages[2] > 0 <= 3 and genders[2] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 0 <= 3 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 4 <= 8 and genders[2] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 4 <= 8 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 9 <= 13 and genders[2] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 9 <= 13 and genders[2] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 14 <= 18 and genders[2] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 14 <= 18 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 19 <= 50 and genders[2] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 19 <= 50 and genders[2] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 51 <= 110 and genders[2] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 51 <= 110 and genders[2] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 4th Person in famly
#########################################
if ages[3] > 0 <= 3 and genders[3] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 0 <= 3 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 4 <= 8 and genders[3] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 4 <= 8 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 9 <= 13 and genders[3] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 9 <= 13 and genders[3] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 14 <= 18 and genders[3] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 14 <= 18 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 19 <= 50 and genders[3] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 19 <= 50 and genders[3] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 51 <= 110 and genders[3] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 51 <= 110 and genders[3] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 5th Person in famly
#########################################
if ages[4] > 0 <= 3 and genders[4] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 0 <= 3 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 4 <= 8 and genders[4] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 4 <= 8 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 9 <= 13 and genders[4] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 9 <= 13 and genders[4] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 14 <= 18 and genders[4] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 14 <= 18 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 19 <= 50 and genders[4] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 19 <= 50 and genders[4] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 51 <= 110 and genders[4] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 51 <= 110 and genders[4] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 6th Person in famly
#########################################
if ages[5] > 0 <= 3 and genders[5] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 0 <= 3 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 4 <= 8 and genders[5] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 4 <= 8 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 9 <= 13 and genders[5] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 9 <= 13 and genders[5] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 14 <= 18 and genders[5] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 14 <= 18 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 19 <= 50 and genders[5] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 19 <= 50 and genders[5] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 51 <= 110 and genders[5] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 51 <= 110 and genders[5] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 0 and ages[2] <= 3 and genders[2] == "Male":
0 will always be <= 3
Output:
What Do you want to spend on grocerys 1
Do somthing
How Many People Are In Your Famly 1
How old... 5
[5]
What gender... Male
['Male']
Error:
Traceback (most recent call last):
File "C:\Users\TFish\Desktop\Python\Culminating.py", line 290, in <module>
if ages[1] > 0 and ages[1] <= 3 and genders[1] == "Male":
IndexError: list index out of range
try add an 'index' variable and put 'if index<peopleInFamly' statement just below each '#For num Person in Family' to terminate the evaluation when the index exceeds the peopleInFamly limits. and also you should change every 'if statement' in your original code to what Laz+60 posted.They are shorter codes to do this but i retain the original code to suit your current coding skills
#User Inputs
while True:
try:
peopleInFamly = int(input("How Many People Are In Your Famly "))
# Amount Of Weeks Do You wanna Buy Groceries For
except ValueError:
print("Invalid Input Please Try Again")
continue
else:
break
ages = []
genders = []
for x in range(peopleInFamly):
age = int(input("How old... "))
ages.append(age)
print (ages)
gender = input("What gender... ")
genders.append(gender)
print (genders)
index = 0
# For 1st Person in famly
#########################################
if index < peopleInFamly:
if ages[0] > 0 <= 3 and genders[0] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 0 <= 3 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 4 <= 8 and genders[0] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 4 <= 8 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 9 <= 13 and genders[0] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 9 <= 13 and genders[0] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 14 <= 18 and genders[0] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 14 <= 18 and genders[0] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 19 <= 50 and genders[0] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 19 <= 50 and genders[0] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[0] > 51 <= 110 and genders[0] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[0] > 51 <= 110 and genders[0] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 2nd Person in famly
index += 1
if index < peopleInFamly:
#########################################
if ages[1] > 0 <= 3 and genders[1] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 0 <= 3 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 4 <= 8 and genders[1] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 4 <= 8 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 9 <= 13 and genders[1] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 9 <= 13 and genders[1] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 14 <= 18 and genders[1] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 14 <= 18 and genders[1] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 19 <= 50 and genders[1] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 19 <= 50 and genders[1] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[1] > 51 <= 110 and genders[1] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[1] > 51 <= 110 and genders[1] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 3rd Person in famly
index += 1
if index < peopleInFamly:
#########################################
if ages[2] > 0 <= 3 and genders[2] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 0 <= 3 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 4 <= 8 and genders[2] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 4 <= 8 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 9 <= 13 and genders[2] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 9 <= 13 and genders[2] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 14 <= 18 and genders[2] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 14 <= 18 and genders[2] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 19 <= 50 and genders[2] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 19 <= 50 and genders[2] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[2] > 51 <= 110 and genders[2] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[2] > 51 <= 110 and genders[2] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 4th Person in famly
index += 1
if index < peopleInFamly:
#########################################
if ages[3] > 0 <= 3 and genders[3] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 0 <= 3 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 4 <= 8 and genders[3] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 4 <= 8 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 9 <= 13 and genders[3] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 9 <= 13 and genders[3] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 14 <= 18 and genders[3] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 14 <= 18 and genders[3] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 19 <= 50 and genders[3] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 19 <= 50 and genders[3] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[3] > 51 <= 110 and genders[3] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[3] > 51 <= 110 and genders[3] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 5th Person in famly
index += 1
if index < peopleInFamly:
#########################################
if ages[4] > 0 <= 3 and genders[4] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 0 <= 3 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 4 <= 8 and genders[4] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 4 <= 8 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 9 <= 13 and genders[4] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 9 <= 13 and genders[4] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 14 <= 18 and genders[4] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 14 <= 18 and genders[4] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 19 <= 50 and genders[4] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 19 <= 50 and genders[4] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[4] > 51 <= 110 and genders[4] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[4] > 51 <= 110 and genders[4] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
# For 6th Person in famly
index += 1
if index < peopleInFamly:
#########################################
if ages[5] > 0 <= 3 and genders[5] == "Male":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 0 <= 3 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 4 <= 8 and genders[5] == "Male":
foodGroupGrains = 4
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1300
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 4 <= 8 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 5
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1200
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 9 <= 13 and genders[5] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1800
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 9 <= 13 and genders[5] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 6
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1600
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 14 <= 18 and genders[5] == "Male":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 4
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 14 <= 18 and genders[5] == "Female":
foodGroupGrains = 3
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 4
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 1
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 19 <= 50 and genders[5] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 8
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2200
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 19 <= 50 and genders[5] == "Female":
foodGroupGrains = 8
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 9
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 2
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2100
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
if ages[5] > 51 <= 110 and genders[5] == "Male":
foodGroupGrains = 7
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 3
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 2000
totalCaloriesNeededStore.append(foodGroupProteins)
if ages[5] > 51 <= 110 and genders[5] == "Female":
foodGroupGrains = 6
foodGroupGrainsStore.append(foodGroupGrains)
foodGroupFruitsAndVegtables = 7
foodGroupFruitsAndVegtablesStore.append(foodGroupFruitsAndVegtables)
foodGroupDairy = 3
foodGroupDairyStore.append(foodGroupDairy)
foodGroupProteins = 2
foodGroupProteinsStore.append(foodGroupProteins)
totalCaloriesNeeded = 1700
totalCaloriesNeededStore.append(foodGroupProteins)
#########################################
print 'all family members evaluated'