摘要: 爬取地址: http://www.zuihaodaxue.com/zuihaodaxuepaiming2018.html‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬ 阅读全文
posted @ 2020-12-14 14:57 英魂 阅读(165) 评论(0) 推荐(0)
摘要: 这是一个简单的html页面,请保持为字符串,完成后面的计算要求。 from bs4 import BeautifulSoup import re html = ''' <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(r 阅读全文
posted @ 2020-12-14 14:53 英魂 阅读(381) 评论(0) 推荐(0)
摘要: 请用requests库的get()函数访问如下一个网站20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度。 import requests def gethtml(): url = "https://www.sogou.com/" try: r=re 阅读全文
posted @ 2020-12-14 14:14 英魂 阅读(151) 评论(0) 推荐(0)
摘要: # 比赛规则: # 1. 采用5局3胜制 # 2. 前四局采用25分制,每个队只有在赢得至少25分,且同时超过对方2分时才胜一局 # 3. 决胜局(第五局)采用15分制,先获得15分,且同时超过对方2分为胜 from random import random def getInputs(): #获得 阅读全文
posted @ 2020-11-22 00:12 英魂 阅读(134) 评论(0) 推荐(0)
摘要: Numpy(为大型多维数组和矩阵添加 Python 支持,并提供高级的数学函数来运算这些数组。) NumPy 数组属性 ndarray.ndim() 用于返回数组的维数,等于秩。 ndarray.shape() 表示数组的维度,返回一个元组,这个元组的长度就是维度的数目,即 ndim 属性(秩)。比 阅读全文
posted @ 2020-11-22 00:05 英魂 阅读(161) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-11-13 18:37 英魂 阅读(165) 评论(0) 推荐(0)
摘要: import jieba excludes = {"什么","一个","我们","那里","你们","如今","说道","知道","起来","姑娘","这里","出来","他们","众人","自己", "一面","只见","怎么",&quo 阅读全文
posted @ 2020-11-13 18:34 英魂 阅读(695) 评论(0) 推荐(0)
摘要: #1. activity = ["上山去砍柴","开车去东北","最爱打游戏"] for i in range(3): print("小明,10岁,男,"+activity[i]) print("") for i in range(3): print("老李,90岁,男,"+activity[i]) 阅读全文
posted @ 2020-11-01 11:29 英魂 阅读(89) 评论(0) 推荐(0)
摘要: 自己写的方法 import turtle as t def square(n):#画一个正方形,pendown和penup可选择是否显示路径 for i in range(4): t.pendown() t.fd(n) t.left(90) t.penup() def BTW():#先白后黑 for 阅读全文
posted @ 2020-10-20 21:44 英魂 阅读(1071) 评论(0) 推荐(0)
摘要: import turtle, datetime def drawGap(): # 绘制数码管间隔 turtle.penup() turtle.fd(5) def drawLine(draw): # 绘制单段数码管 drawGap() turtle.pendown() if draw else tur 阅读全文
posted @ 2020-10-19 01:05 英魂 阅读(164) 评论(0) 推荐(0)