摘要:
import pygame import sys import random # 素材参考地址:https://www.aigei.com/s?q=flappy+bird&type=2d class Bird(object): """定义一个鸟类""" def __init__(self): """ 阅读全文
posted @ 2023-12-20 08:56
陆宇柒
阅读(36)
评论(0)
推荐(0)
摘要:
Numpy: 基础的数学计算模块,来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structure)结构要高效的多,本身是由C语言开发。这个是很基础的扩展,其余的扩展都是以此为基础。数据结构为ndarray,一般有三种方式来创建。 Scipy: 方便、易于使用、专为科学 阅读全文
posted @ 2023-12-20 08:52
陆宇柒
阅读(7)
评论(0)
推荐(0)
摘要:
print("乒乓球比赛,学号21") from random import random def printInfo(): print('这个程序模拟两个选手A和B的某种竞技比赛') print('程序运行需要A和B的能力值(以0到1之间的小数表示)') def getInputs(): a = 阅读全文
posted @ 2023-12-20 08:49
陆宇柒
阅读(9)
评论(0)
推荐(0)
摘要:
import jieba txt = open("西游记.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) # 使用精确模式对文本进行分词 counts = {} # 通过键值对的形式存储词语及其出现的次数 for word in 阅读全文
posted @ 2023-12-20 08:46
陆宇柒
阅读(11)
评论(0)
推荐(0)