摘要: 1.请用requests库的get()函数访问谷歌网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。 import requestsfor i in range (20): print("第",i+1,"次访问") r=requests.get 阅读全文
posted @ 2020-12-14 00:00 Elaine-- 阅读(99) 评论(0) 推荐(0)
摘要: 1、基本函数用法 Numpy: 基础的数学计算模块,来存储和处理大型矩阵,比Python自身的嵌套列表(nested list structure)结构要高效的多,本身是由C语言开发。这个是很基础的扩展,其余的扩展都是以此为基础。数据结构为ndarray,一般有三种方式来创建。 Scipy: 方便、 阅读全文
posted @ 2020-11-22 23:55 Elaine-- 阅读(105) 评论(0) 推荐(0)
摘要: b.采用排球比赛规则(学号尾号为4,5,6同学必做及格题)。赛制规定:‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‮‬ ‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬ 阅读全文
posted @ 2020-11-22 13:42 Elaine-- 阅读(141) 评论(0) 推荐(0)
摘要: import jiebafrom collections import Counterimport matplotlib.pyplot as pltimport numpy as np class HlmNameCount(): # 此函数用于绘制条形图 def showNameBar(self,n 阅读全文
posted @ 2020-11-14 15:10 Elaine-- 阅读(379) 评论(0) 推荐(0)
摘要: import turtle as timport timedef popspace(): #单管间隔 t.penup() t.fd(4)def popline(draw): #画数码管 popspace() t.pendown() if draw else t.penup() t.fd(40) po 阅读全文
posted @ 2020-10-18 19:18 Elaine-- 阅读(380) 评论(0) 推荐(0)
摘要: 一、要求 1.要起义能计算到圆周率后面越多位越好。 2.用进度条显示计算的进度,能给出越多种进度条越好。 3.要求给出圆周率π的具体公式或者算法说明。 二、算法 1、马青公式:马青公式每计算一项可以得到1.4位的十进制精度。 2、蒙特卡罗法(我们使用这种方法) 一个正方形内部相切一个圆,圆和正方形的 阅读全文
posted @ 2020-10-11 00:15 Elaine-- 阅读(655) 评论(0) 推荐(0)
摘要: import turtle as timport timet.color("red", "yellow")t.speed(10)t.begin_fill()for _ in range(50): t.forward(200) t.left(170)end_fill()time.sleep(1) 阅读全文
posted @ 2020-09-21 20:51 Elaine-- 阅读(645) 评论(0) 推荐(0)
摘要: import turtle as tt.penup()t.fd(-100)t.pendown()t.pensize(5)t.color("lightpink")t.seth(-60)t.fd(200)t.seth(60)t.fd(200)t.seth(-180)t.fd(200)t.seth(60) 阅读全文
posted @ 2020-09-15 21:00 Elaine-- 阅读(307) 评论(0) 推荐(0)
摘要: #绘制六角形import turtle as tt.penup()t.fd(-80)t.pendown()t.seth(90)for i in range(6): t.left(60) t.fd(100) t.right(120) t.fd(100)t.fd(100)for i in range(5 阅读全文
posted @ 2020-09-15 20:56 Elaine-- 阅读(361) 评论(0) 推荐(0)
摘要: #五角星绘制import turtle as tt.setup(500,500,200,200)t.penup()t.fd(-150)t.pendown()t.fillcolor("red")t.begin_fill()for i in range(5): t.fd(300) t.right(180 阅读全文
posted @ 2020-09-15 20:40 Elaine-- 阅读(207) 评论(0) 推荐(0)