12 2023 档案

摘要: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:54 廖晟崴 阅读(42) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-12-29 00:40 廖晟崴 阅读(12) 评论(0) 推荐(0)
摘要:搜狗网页 import requests url = "https://www.sogou.com" for _ in range(20): response = requests.get(url) print(f"返回状态:{response.status_code}") text_length 阅读全文
posted @ 2023-12-29 00:31 廖晟崴 阅读(31) 评论(0) 推荐(0)
摘要:Numpy NumPy主要用途包括: 数学运算:提供了丰富的数学函数和操作符,例如对数组进行加减乘除、三角函数、指数函数等。 线性代数:支持矩阵乘法、求逆、特征值分解等线性代数运算。 随机数生成:能够生成各种概率分布的随机数。 Scipy Scipy的主要应用场景包括: 优化和拟合:提供了多种优化算 阅读全文
posted @ 2023-12-28 23:58 廖晟崴 阅读(41) 评论(0) 推荐(0)
摘要:from random import random # 打印程序介绍信息 def printIntro(): print("22信计1班23号") print("这是单人赛模拟程序:") # 获得程序运行参数 def getInputs(): a = eval(input("请输入选手A的能力值(0 阅读全文
posted @ 2023-12-28 22:49 廖晟崴 阅读(25) 评论(0) 推荐(0)
摘要:import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in 阅读全文
posted @ 2023-12-28 22:38 廖晟崴 阅读(42) 评论(0) 推荐(0)