摘要: import pygameimport sysimport randomclass Bird(object): """定义一个鸟类""" def __init__(self): """定义初始化方法""" # 鸟的矩形有四个参数:前两个是小鸟矩形左上角的坐标点,后两个是矩形的长宽 self.bird 阅读全文
posted @ 2023-12-31 23:54 Dry8 阅读(42) 评论(0) 推荐(0)
摘要: 2)jieba分词 import jiebawith open("C:\\Users\\小瑜\\Documents\\Downloads\\《西游记》.txt", 'r', encoding='utf_8') as f: words = jieba.lcut(f.read()) # 使用精确模式对文 阅读全文
posted @ 2023-12-18 21:28 Dry8 阅读(32) 评论(0) 推荐(0)
摘要: (二) import requestsurl="https://www.sogou.com/"def gethtml(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print("text内容:",r.te 阅读全文
posted @ 2023-12-08 21:20 Dry8 阅读(26) 评论(0) 推荐(0)
摘要: import turtle, datetimedef drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if draw else turt 阅读全文
posted @ 2023-11-21 21:35 Dry8 阅读(29) 评论(0) 推荐(0)
摘要: 03 a=float(input('扫描的第一个商品价格:'))b=float(input('扫描的第二个商品价格:'))c=float(input('扫描的第三个商品价格:'))d=a+b+cprint('总计:',int(d)) print("143133") 04 stb = float(in 阅读全文
posted @ 2023-11-01 00:52 Dry8 阅读(17) 评论(0) 推荐(0)
摘要: from math import*from time import*scale=20s,m,=1,2print("执行开始".center(scale//2, "-"))start = perf_counter()for i in range(scale+1): s=sqrt((1-sqrt(1-p 阅读全文
posted @ 2023-10-29 21:32 Dry8 阅读(27) 评论(0) 推荐(0)