The Math library has many functions
that are useful for programs that need to perform mathematical operations, that
cannot be accomplished using the built in operators.
The best way to learn new
things is to take a practical approach of the things you want to learn. Here is a fragment
of code that demonstrates
the use of the Health Calculator statement in Python:
Æ’ python command
import math
def
HealthCalculator(age,apples,cigarettes):
answer = ( (100-age) + (apples*1.3) - (cigarettes*2) )
print('You will live ' + str(math.trunc(answer))+ ' years!')
John_Smith = [35, 20 ,20]
HealthCalculator(*John_Smith)
√ output
You will live 51 years!
Sign up here with your email

1 comments:
Write commentsSome us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
ReplySurya Informatics
ConversionConversion EmoticonEmoticon