5.6 (Part 1) Calories from Fat and Carbohydrates - Python

in #programming7 years ago

Starting out with Python, Third Edition, Tony Gaddis
Chapter 5
Programming Challenges

  1. Calories from Fat and Carbohydrates

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 x 9

Next, she calculates the number of calories that result from the carbohydrates, using the following formula:

calories from carbs = carb grams x 4

The nutritionist asks you to write a program that will make these calculations.

Starting out Python. Third Edition. Tony Gaddis.

Happy Steeming Everyone! :)

Sort:  

very easy, but it is difficult to do, post i like

Hi noeva, practice makes perfect so don't fret at all. Keep at it and you'll be a pro in no time :)

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64303.16
ETH 3137.29
USDT 1.00
SBD 3.97