摘要: (2)请用requests库的get()函数访问如下一个网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。(不同学号选做如下网页,必做及格)‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬ 阅读全文
posted @ 2020-12-13 23:20 whispe 阅读(90) 评论(0) 推荐(0)
摘要: 1.numpy array是list一个很好的补充,numpy array可以进行数组的整体操作。 a=np.array([1,2,3,4,5]) b=np.array([1,2,3,4,5]) c=a/b 2.numpy构造数组子集的操作很方便,并进行数据统计。 import numpy as n 阅读全文
posted @ 2020-11-23 08:38 whispe 阅读(64) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- """ Created on Tue Jun 9 11:18:48 2020 @author: 13549 """ from random import random #第一阶段 def printIntro(): print("模拟两个选手A和B的羽 阅读全文
posted @ 2020-11-22 14:37 whispe 阅读(70) 评论(0) 推荐(0)
摘要: import jieba txt = open("聊斋志异.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) counts = {} for word in words: if len(word) == 1: continue e 阅读全文
posted @ 2020-11-15 11:35 whispe 阅读(87) 评论(0) 推荐(0)
摘要: import turtle,time def drawGap(): turtle.penup() turtle.fd(5) def drawLine(draw): drawGap() turtle.pendown()if draw else turtle.penup() turtle.fd(40) 阅读全文
posted @ 2020-10-18 15:11 whispe 阅读(88) 评论(0) 推荐(0)
摘要: import math import time scale=10 print("执行开始") t=time.process_time() for i in range(scale+1): a,b='**'*i,'..'*(scale-i) c=(i/scale)*100 π=4*(4*math.at 阅读全文
posted @ 2020-10-10 23:57 whispe 阅读(155) 评论(0) 推荐(0)
摘要: import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.fd(-250) turtle.pendown() turtle.pensize(25) turtle.pencolor("purple") turtle.set 阅读全文
posted @ 2020-09-21 23:13 whispe 阅读(89) 评论(0) 推荐(0)
摘要: import turtle >>> turtle.right(60) >>> turtle.forward(200) >>> turtle.right(120) >>> turtle.forward(200) >>> turtle.right(120) >>> turtle.forward(200) 阅读全文
posted @ 2020-09-15 22:57 whispe 阅读(167) 评论(0) 推荐(0)
摘要: import turtle >>> turtle.setup(600,500) >>> turtle.fillcolor('green') >>> turtle.pensize(5) >>> turtle.begin_fill() >>> turtle.seth(30) >>> for i in r 阅读全文
posted @ 2020-09-15 21:18 whispe 阅读(141) 评论(0) 推荐(0)
摘要: > import turtle >>> turtle.setup(500,500) >>> turtle.fillcolor("red") >>> turtle.begin_fill() >>> for i in range(5): turtle.fd(200) turtle.right(144) 阅读全文
posted @ 2020-09-15 20:43 whispe 阅读(145) 评论(0) 推荐(0)