摘要:
import random li = [] def fahongbao(money,num=6): if money > 0 and num != 1: n = round(random.uniform(0.01,money - (0.01 * num)),2) num -= 1 li.append(n) money -= ... 阅读全文
posted @ 2018-08-23 20:56
背锅文
阅读(259)
评论(0)
推荐(0)
摘要:
import re def atom_cal(exp): # 计算乘除法 if '*' in exp: a,b = exp.split('*') return str(float(a) * float(b)) elif '/' in exp: a, b = exp.split('/') return str(floa... 阅读全文
posted @ 2018-08-23 20:54
背锅文
阅读(177)
评论(0)
推荐(0)
摘要:
模块和包: 1.如何自己写一个模块 模块可以包含可执行的语句和函数的定义,这些语句的目的是初始化模块,它们只在模块名第一次遇到导入import语句时才执行(import语句是可以在程序中的任意位置使用的,且针对同一个模块很import多次,为了防止你重复导入,python的优化手段是:第一次导入后就 阅读全文
posted @ 2018-08-23 18:56
背锅文
阅读(158)
评论(0)
推荐(0)
摘要:
异常处理: 阅读全文
posted @ 2018-08-23 18:00
背锅文
阅读(134)
评论(0)
推荐(0)

浙公网安备 33010602011771号