摘要: import jiebatxt = open("D:\python课本内容\聊斋志异.txt","r",encoding = 'utf-8').read()words = jieba.lcut(txt)counts = {}for word in words: if len(word) == 1: 阅读全文
posted @ 2023-12-19 20:45 刘珈麟 阅读(29) 评论(0) 推荐(0)
摘要: numpy、scipy、pandas、matplotlib的读书报告:‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬ 评分标准:‪‬‪‬‪‬‪‬‪‬‮‬‫ 阅读全文
posted @ 2023-12-19 17:39 刘珈麟 阅读(59) 评论(0) 推荐(0)
摘要: def main(): printintro() proba, probb, n = printinputs() winsa, winsb = simngames(n, proba, probb) printsummary(winsa, winsb) #打印程序介绍信息 def printintro 阅读全文
posted @ 2023-12-17 21:59 刘珈麟 阅读(45) 评论(0) 推荐(0)
摘要: from random import randomdef printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)")def getInputs(): a = eval(input("请输入选手A的能力 阅读全文
posted @ 2023-11-20 22:49 刘珈麟 阅读(103) 评论(0) 推荐(0)
摘要: from random import randomdef printIntro(): print("这个程序模拟两个选手A和B的某种竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)")def getInputs(): a = eval(input("请输入选手A的能力 阅读全文
posted @ 2023-11-20 22:49 刘珈麟 阅读(93) 评论(0) 推荐(0)
摘要: import turtle, datetimedef drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if draw else turt 阅读全文
posted @ 2023-11-19 17:41 刘珈麟 阅读(32) 评论(0) 推荐(0)
摘要: class Tiao(object): def __init__(self): self.obj1 = datetime.timedelta(seconds=1) self.var = '%H:%M:%S' def add(self, var): a = datetime.datetime.strp 阅读全文
posted @ 2023-11-13 22:21 刘珈麟 阅读(32) 评论(0) 推荐(0)
摘要: #03运行超市抹零结账行为num = float(input("请输入你需要支付的价格"))print(int(num))#04计算学生成绩的分差和平均分num = eval(input("请输入班级的人数:"))sum = 0IsError = Falsefor i in range(1,num+ 阅读全文
posted @ 2023-10-31 19:28 刘珈麟 阅读(34) 评论(0) 推荐(0)
摘要: from random import randomfrom math import sqrtfrom time import perf_counterDARTS = 10000000hits = 0.0perf_counter()for i in range(1,DARTS+1): x,y = ra 阅读全文
posted @ 2023-10-30 20:33 刘珈麟 阅读(36) 评论(0) 推荐(0)