Enly

导航

2023年12月27日

读书报告

摘要: #numpy 1.基本函数的用法: 1 import numpy as np 2 3 a = np.ones((4,5)) 4 print(a) 5 print("\n") 6 print(a.ndim) 7 print(a.shape) 8 print(a.dtype) 9 print("\n") 阅读全文

posted @ 2023-12-27 10:11 Enly_321 阅读(1) 评论(0) 推荐(0) 编辑

模拟体育竞赛分析

摘要: 1)乒乓球 1 from random import random 2 def printIntro(): 3 print("学号02 \n这个程序是模拟两个选手A和B的某种竞技比赛") 4 print("程序运行需要A和B的能力值(0-1)") 5 def getTnputs(): 6 a=eva 阅读全文

posted @ 2023-12-27 10:11 Enly_321 阅读(2) 评论(0) 推荐(0) 编辑

falppy bird小游戏

摘要: 1 import pygame 2 import sys 3 import random 4 # 素材参考地址:https://www.aigei.com/s?q=flappy+bird&type=2d 5 6 class Bird(object): 7 """定义一个鸟类""" 8 def __i 阅读全文

posted @ 2023-12-27 09:43 Enly_321 阅读(3) 评论(0) 推荐(0) 编辑

2023年12月17日

作业五:jieba分词——西游记相关的分词,出现次数最高的20个。

摘要: 1 import jieba 2 ''' 3 f = open("D:/学习/个人/pythonwork/西游记.txt", 'r', encoding='utf-8') 4 txt =f.read() 5 if txt.startswith(u'\ufeff'): 6 content = txt. 阅读全文

posted @ 2023-12-17 22:32 Enly_321 阅读(4) 评论(0) 推荐(0) 编辑

2023年12月12日

作业四:爬虫

摘要: 1.请用requests库的get()函数访问如下一个网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。 1 import requests 2 3 url = "https://www.baidu.com/" # 将此URL替换为您要访问的网 阅读全文

posted @ 2023-12-12 16:44 Enly_321 阅读(16) 评论(0) 推荐(0) 编辑