詹惠儿

2019-01-07   阅读量: 588

数据分析师

python中的数学函数(2)

扫码加入数据分析学习群

3. fabs(): - 此函数返回数字的绝对值

4. factorial(): - 此函数返回数字的阶乘。如果数字不是整数,则会显示错误消息

# Python code to demonstrate the working of

# fabs() and factorial()

# importing "math" for mathematical operations

import math

a = -10

b= 5

# returning the absolute value.

print ("The absolute value of -10 is : ", end="")

print (math.fabs(a))

# returning the factorial of 5

print ("The factorial of 5 is : ", end="")

print (math.factorial(b))

添加CDA认证专家【维克多阿涛】,微信号:【cdashijiazhuang】,提供数据分析指导及CDA考试秘籍。已助千人通过CDA数字化人才认证。欢迎交流,共同成长!
0.0000 0 4 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子