摘要: import pygame import sys import random import numpy as np class Bird(object): """定义一个鸟类""" def __init__(self): """定义初始化方法""" self.birdRect = pygame.Re 阅读全文
posted @ 2023-12-29 00:58 Partikel 阅读(12) 评论(0) 推荐(0)
摘要: NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库。 NumPy 通常与 SciPy(Scientific Python)和 Matplotlib(绘图库)一起使用, 这种组合广泛用于替代 Ma 阅读全文
posted @ 2023-12-29 00:39 Partikel 阅读(30) 评论(0) 推荐(0)
摘要: import jieba path = "聊斋.txt" file = open(path, "r", encoding="utf-8") text = file.read() file.close() words = jieba.lcut(text) counts = {} for word in 阅读全文
posted @ 2023-12-29 00:38 Partikel 阅读(15) 评论(0) 推荐(0)
摘要: from random import random def printIntro(): print("模拟两个选手A和B的羽毛球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A的能力值(0 阅读全文
posted @ 2023-12-26 20:21 Partikel 阅读(34) 评论(0) 推荐(0)
摘要: 爬虫作业 import requests url="https://www.so.comsrc=so.com" def getHTMLText(url): try: r=requests.get(url) r.raise_for_status() r.encoding="utf-8" print(" 阅读全文
posted @ 2023-12-13 01:16 Partikel 阅读(10) 评论(0) 推荐(0)
摘要: import turtle, datetime def drawGap(): turtle.penup() turtle.fd(5) def drawLine(draw): drawGap() turtle.pendown() if draw else turtle.penup() turtle.f 阅读全文
posted @ 2023-11-22 16:56 Partikel 阅读(44) 评论(0) 推荐(0)
摘要: 运行超市抹零结账行为 num = float(input("您的结账金额为")) num1 = int(num) print(num1) print("3118") 计算学生的分差和平均值 python=int(input()) english=int(input()) c=int(input()) 阅读全文
posted @ 2023-11-01 11:13 Partikel 阅读(23) 评论(0) 推荐(0)