Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
def main():

# Ask for the number of fat grams.
fat_grams = input('Enter the number of fat grams consumed: ')
fat_calories(fat_grams)

# Ask for the number of carb grams.
carb_grams = input('Enter the number of carbohydrate grams consumed: ')
carb_calories(carb_grams)

def fat_calories(fat_grams):
# Calculate the calories from fat.
# calories_from_fat = fat_grams*9
calories_from_fat = fat_grams * 9
print 'The calories from fat are', calories_from_fat

def carb_calories(carb_grams):
# Calculate the calories from carbs.
# calories_from_carbs = carb_grams * 4
calories_from_carbs = carb_grams * 4
print 'The calories from carbohydrates are', calories_from_carbs

# Call the main function.
main()

this it what i came up with so far but having trouble develop that algorithm as a Raptor flowchart
Posted
Comments
Sergey Alexandrovich Kryukov 30-Jan-15 19:28pm    
Not a question, no appropriate explanations.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900