摘要: #采用bs4--Beautiful库实现import requestsfrom bs4 import BeautifulSoupimport bs4 #得到网页内容def getHTMLText(url): try: r = requests.get(url,timeout=30) r.raise_ 阅读全文
posted @ 2020-12-14 19:03 NIUFI 阅读(48) 评论(0) 推荐(0)
摘要: import numpy as np ls1 = [10, 42, 0, -17, 30] nd1 =np.array(ls1) print(nd1) print(type(nd1)) fig = plt.figure() ax = fig.add_subplot(2, 2, 1) y = np.r 阅读全文
posted @ 2020-11-23 18:54 NIUFI 阅读(38) 评论(0) 推荐(0)
摘要: # -*- encoding:utf-8 -*- ''' 模拟羽毛球竞技 ''' # 比赛规则: # 2. 前四局采用21分制,每个队只有在赢得至少21分,且同时超过对方2分时才胜一局 from random import random from time import time def print 阅读全文
posted @ 2020-11-23 08:36 NIUFI 阅读(39) 评论(0) 推荐(0)
摘要: import jieba def takeSecond(elem): return elem[1] def main(): path = "E:\聊斋\\31883\\all.txt" file = open(path, "r", encoding="utf-8") text = file.read 阅读全文
posted @ 2020-11-15 10:58 NIUFI 阅读(44) 评论(0) 推荐(0)
摘要: import turtle, datetime def drawGap(): turtle.up() turtle.fd(5) def drawLine(draw): drawGap() if(draw): turtle.down() else: turtle.up() turtle.fd(40) 阅读全文
posted @ 2020-10-19 01:15 NIUFI 阅读(53) 评论(0) 推荐(0)
摘要: pi = 0 N = 100for k in range(N): pi += 1/pow(16,k) * (4/(8*k+1) - 2/(8*k+4) - 1/(8*k+5) - 1/(8*k+6))print("圆周率值是:{}".format(pi)) 阅读全文
posted @ 2020-10-11 11:14 NIUFI 阅读(51) 评论(0) 推荐(0)
摘要: import turtle def drawSnake(rad, angle, len, neckrad): for _ in range(len): turtle.circle(rad, angle) turtle.circle(-rad, angle) turtle.circle(rad, an 阅读全文
posted @ 2020-09-21 19:56 NIUFI 阅读(540) 评论(0) 推荐(0)
摘要: import turtle turtle.fd(100) turtle.left(120) turtle.fd(100) turtle.left(120) turtle.fd(50) turtle.left(120) turtle.fd(50) turtle.right(120) turtle.fd 阅读全文
posted @ 2020-09-15 22:03 NIUFI 阅读(385) 评论(0) 推荐(0)
摘要: import turtle turtle.left(30) turtle.fd(100) turtle.right(120) turtle.fd(150) turtle.right(120) turtle.fd(150) turtle.right(120) turtle.fd(50) turtle. 阅读全文
posted @ 2020-09-15 21:59 NIUFI 阅读(235) 评论(0) 推荐(0)
摘要: from turtle import * fillcolor("red") begin_fill() import turtle turtle.write("刘霏璇", move=False, align="left", font=("Arial", 20, "normal")) while Tru 阅读全文
posted @ 2020-09-15 21:52 NIUFI 阅读(108) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示