fun programing, some interesting programs
a program to test how luck you are, it simulates buying lottery, in China, it calls 大乐透, if you match all the number, you will get 10,000,000 CNY. let's figure out how long will it take to win the biggest prize. 大乐透模拟,选定一注号码,连续投注,每期都买,看看需要多少年你才能中奖。 要自己选注,修改balls变量,前五个球是红球,后两个是蓝球,我选的号是 3,4,12,16,28 + 5,12。
if __name__ == "__main__":
balls = [3,4,12,16,28,5,12]
red = 5
p = printer(red)
l = lottery(p, balls, red)
n = 1;
while(l.draw(n) < 7):
n += 1
p.print_win(n, l.getBalls())
参见文章:你能中1000万吗
An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.
- redis测试
- mysql测试
- 简单Python爬虫--爬小说:Spider
- intelliJ IDEA + Spring boot + freemarker + mybatis项目搭建
- 小说章节自动划分,为了在Sigil里做出有章节的小说,使用Python来自动分割章节和生成目录。 效果
已知问题: 如果小说第一行没有一个空行,那么第一章可能无法识别。