基本操作
import math
result = math.floor(6.2)
print(result)
result = math.ceil(5.5)
print(result)
result = round(8,5)
print(result)
result = math.pow(5,3)
print(result)
result = 5 ** 3
print(result)
result = math.sqrt(5)
print(result)
result = abs(-12)
print(result)
result = math.modf(12.5)
print(result)
result = math.copysign(12,-5)
print(result)
listvar = [4,5,3,7,2,5,6]
result = math.fsum(listvar)
print(result)
listvar = [4,5,3,7,2,5,6]
result = sum(listvar)
print(result)
nums = [3,5,6,0,9,34,56,32,67]
result = max(nums)
print(result)
result = max(23,4,56,21,34,62,8,16)
print(result)
result = min(nums)
print(result)
result = min(23,4,56,21,34,62,8,16)
print(result)
result = range(1,15)
print(result)
for i in result:
print(i)
print(math.pi)
print(math.e)
import random
result = random.random()
print(result)
listvar = [4,5,6,3,8,2,9,'C','D','A','X']
result = random.choice(listvar)
print(result)
listvar = ['mf','sl','yj','lss','cyy']
print(listvar)
random.shuffle(listvar)
print(listvar)
result = random.randrange(3,8,5)
print(result)
result = random.uniform(2,8)
print(result)
var = 15
result = hex(var)
print(result,type(result))
var = 46
result = oct(var)
print(result,type(result))
var = 38
result = bin(var)
print(result,type(result))
'''
ascii码 美国标准信息交换码
0-9 -> 48-57
A-Z -> 65-90
a-z -> 97-122
'''
result = ord('a')
print(result)
result = chr(80)
print(result)
var = '假如生活\'欺骗\'了你\n不要悲伤不要心急'
print(var)
result = repr(var)
print(result)
num = 99
var = 'num + 1'
num = eval(var)
print(num)