Use math library

math library Introduction

math library is built within the Python math library provided, since a plurality of types commonly used in scientific computing, calculation is not generally used, and therefore do not support the type complex math library, only supports integer and floating point arithmetic, the math library provided a total of four mathematical constant 44 and functions. 44 functions divided into four categories, including the value 16 represents a function, the function of the power 8, 16 of triangular functions and special functions four higher.

Example:

P77 3.12

import math
dayup=1.0
dayfactory=eval(input(""))
for i in range(365):
    if i % 7 in [6,0,5]:
        dayup=dayup
    else:
        dayup=dayup*(1+dayfactory)
print(dayup)

 

result:
 

 

1.23   1.52   1.86   2.29   2.82 3.47 4.27 5.25 6.45 7.92

 

Guess you like

Origin www.cnblogs.com/c1q2s3/p/11520598.html