# 调用函数 # 可以直接从Python的官方网站查看文档: # http://docs.python.org/3/library/functions.html#abs n = abs(100) # 求绝对值的函数abs, abs()有且仅有1个参数 print(n) n1 = abs(-20) print(n1) l = max(1, 2) # max函数max()可以接收任意多个参数,并返回最大的那个 print(l) # 数据类型转换 i = int('123') print(i) i1 = int(12.34) print(i1) f = float(12.34) print(f) s = str(1.23) print(s) s1 = str(100) print(s1) b = bool(1) print(b) b1 = bool('') print(b1) x = abs(100) y = abs(-20) print(x, y) print('max(1, 2, 3)= ', max(1, 2, 3)) print('min(1, 2, 3)=', min(1, 2, 3)) print('sum[1, 2, 3]=', sum([1, 2, 3]))