Question: NOTE : Is learning Python programming (currently on chapter 5) with the following textbook: Book Starting Out With Python 3rd Edition by Gaddis
NOTE: Is learning "Python programming" (currently on chapter 5) with the following textbook:
Book "Starting Out With Python" 3rd Edition by Gaddis

2. A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams * 9 Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs - carb grams * 4 The nutritionist asks you to write a program that will make these calculations. Use a function that will allow you to display both calculations (by passing in the number of grams and the number of calories per gram) /workspace/HH/ $ python numbero Enter number of fat grams you ate today: 10 Enter number of carb grams you ate today: 20 10 grams have 90 calories 20 grams have 80 calories
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
