摘要: 一、小鸟管道游戏 import pygame import sys import random class Bird(object): """定义一个鸟类""" def __init__(self): """定义初始化方法""" self.birdRect = pygame.Rect(65, 50, 阅读全文
posted @ 2023-12-25 19:31 李想2022310143126 阅读(16) 评论(0) 推荐(0)
摘要: (2)请用requests库的get()函数访问如下一个网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。(不同学号选做如下网页,必做及格) import requests url = "https://www.baidu.com/" for 阅读全文
posted @ 2023-12-25 19:13 李想2022310143126 阅读(14) 评论(0) 推荐(0)
摘要: Numpy(为大型多维数组和矩阵添加 Python 支持,并提供高级的数学函数来运算这些数组。) NumPy 数组属性 ndarray.ndim() 用于返回数组的维数,等于秩。 ndarray.shape() 表示数组的维度,返回一个元组,这个元组的长度就是维度的数目,即 ndim 属性(秩)。比 阅读全文
posted @ 2023-12-20 11:17 李想2022310143126 阅读(52) 评论(0) 推荐(0)
摘要: 尾号为4,5,6的同学做,红楼梦相关的分词,出现次数最高的20个。 import jieba txt = open("D:\pycharm\python123\jieba分词作业\红楼梦.txt","r",encoding = 'utf-8').read() words = jieba.lcut(t 阅读全文
posted @ 2023-12-20 10:58 李想2022310143126 阅读(25) 评论(0) 推荐(0)
摘要: b.采用排球比赛规则(学号尾号为4,5,6同学必做及格题)。赛制规定:‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬前4局 阅读全文
posted @ 2023-12-20 10:46 李想2022310143126 阅读(45) 评论(0) 推荐(0)
摘要: import time import turtle as tt def drawGap(): tt.penup() tt.fd(5) def drawLine(draw): drawGap() if(draw): tt.pendown() else: tt.penup() tt.fd(50) dra 阅读全文
posted @ 2023-11-20 19:37 李想2022310143126 阅读(7) 评论(0) 推荐(0)
摘要: PI = 0 N = 1000 for n in range(int(N)): PI += 1/pow(16,n) * (4/(8*n+1) - 2/(8*n+4) - 1/(8*n+5) - 1/(8*n+6)) print(PI) import sys, timeclass ShowProces 阅读全文
posted @ 2023-10-30 08:30 李想2022310143126 阅读(34) 评论(0) 推荐(0)
摘要: 03运行超市抹零结账行为 money_all=67.99+11.75+21.1+8.49+25.89+17.5+22.4 money_all_str=str(money_all) print("商品总金额为:",money_all_str) money_real=int(money_all) mon 阅读全文
posted @ 2023-10-28 22:07 李想2022310143126 阅读(33) 评论(0) 推荐(0)