摘要: (2)请用requests库的get()函数访问如360网址20次 import requests from bs4 import BeautifulSoup def getHTMLText(url): try: r=requests.get(url,timeout=30) soup=Beautif 阅读全文
posted @ 2020-12-14 01:16 九木德 阅读(44) 评论(0) 推荐(0)
摘要: #体育竞技 from random import random def printInfo(): print("这个程序模拟两个选手A和B的羽毛球竞技比赛") print("程序需要两个选手的能力值0-1") print("规则:三局两胜--21分制") print("作者:18邱淑慧") def 阅读全文
posted @ 2020-11-23 08:58 九木德 阅读(66) 评论(0) 推荐(0)
摘要: NumPy篇 numpy.around() 函数返回指定数字的四舍五入值 numpy.floor() numpy.floor() 返回小于或者等于指定表达式的最大整数,即向下取整 numpy.ceil() numpy.ceil() 返回大于或者等于指定表达式的最小整数,即向上取整 numpy.rec 阅读全文
posted @ 2020-11-23 08:50 九木德 阅读(70) 评论(0) 推荐(0)
摘要: import jieba txt = open("聊斋志异白话简写版.txt", "r", encoding='utf-8').read()words = jieba.lcut(txt) # 使用精确模式对文本进行分词counts = {} # 通过键值对的形式存储词语及其出现的次数 for wor 阅读全文
posted @ 2020-11-15 11:29 九木德 阅读(85) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-11-15 10:49 九木德 阅读(90) 评论(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-26 18:15 九木德 阅读(70) 评论(0) 推荐(0)
摘要: pi = 0 N = 100 for 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-26 18:01 九木德 阅读(52) 评论(0) 推荐(0)
摘要: import turtle turtle.pensize(6) turtle.pencolor("yellow") turtle.fillcolor("red") turtle.begin_fill() for i in range(5): turtle.forward(99) turtle.rig 阅读全文
posted @ 2020-09-28 19:53 九木德 阅读(83) 评论(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 20:00 九木德 阅读(227) 评论(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 12:23 九木德 阅读(78) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示