摘要: (1)请用requests库的get()函数访问360主页20次,打印返回状态,text()内容,计算text()属性和content属性所返回网页内容的长度 import requests r=requests.get("http://www.360.com",timeout=30) r.enco 阅读全文
posted @ 2020-12-13 21:45 JokerMaQ 阅读(68) 评论(0) 推荐(0)
摘要: from random import random #第一阶段 def printIntro(): print("模拟两个选手A和B的羽毛球比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = eval(input("请输入选手A 阅读全文
posted @ 2020-11-16 20:01 JokerMaQ 阅读(122) 评论(0) 推荐(0)
摘要: import jieba text=open('E:/聊斋志异/聊斋志异.txt',"r",encoding='utf-8').read() words=jieba.lcut(text) counts={} for word in words: if len(word)==1: #排除带个字符的分词 阅读全文
posted @ 2020-11-14 16:40 JokerMaQ 阅读(74) 评论(0) 推荐(0)
摘要: print("小明, 10岁, 男,上山去砍柴") print("小明, 10岁, 男,开车去东北") print("小明, 10岁, 男,最爱打游戏") print("\n") print("老李, 90岁, 男,上山去砍柴") print("老李, 90岁, 男,开车去东北") print("老 阅读全文
posted @ 2020-10-27 15:21 JokerMaQ 阅读(55) 评论(0) 推荐(0)
摘要: import time import turtle as tt # 绘制间隔 def drawGap(): tt.penup() tt.fd(3) # 绘制单段数码管 def drawLine(draw): drawGap() if(draw): tt.pendown() else: tt.penu 阅读全文
posted @ 2020-10-17 16:21 JokerMaQ 阅读(258) 评论(0) 推荐(0)
摘要: 圆周率Pi具体公式 π/4=1-1/3+1/5-1/7+1/9-1/11+... 代码 import math import time scale=10 print("执行开始") t=time.process_time() for i in range(scale+1): a,b='**'*i,' 阅读全文
posted @ 2020-10-09 16:15 JokerMaQ 阅读(429) 评论(0) 推荐(0)
摘要: import turtle as t t.setup(600, 600, None,None) t.pu() t.fd(-120) t.pensize(5) t.width(5) t.pencolor("orange") t.pd() t.fd(250) t.seth(120) t.pencolor 阅读全文
posted @ 2020-09-14 21:59 JokerMaQ 阅读(304) 评论(0) 推荐(0)
摘要: import turtle turtle.left(30) turtle.forward(144) turtle.right(60) turtle.forward(144) turtle.right(60) turtle.forward(144) turtle.right(60) turtle.fo 阅读全文
posted @ 2020-09-14 21:44 JokerMaQ 阅读(90) 评论(0) 推荐(0)
摘要: from turtle import * fillcolor("red") begin_fill() while True: forward(200) right(144) if abs(pos()) < 1: break end_fill() import turtle t=turtle.Turt 阅读全文
posted @ 2020-09-14 21:24 JokerMaQ 阅读(113) 评论(0) 推荐(0)