2021年1月11日
摘要: import turtle, time def drawGap():turtle.speed(0) # 设置画笔速度 “fastest”:0 "fast":10 "normal":6 "slow":3 "slowest":1# turtle.Turtle().screen.delay(0) #画笔速 阅读全文
posted @ 2021-01-11 16:46 RUNFIFA 阅读(74) 评论(0) 推荐(0)
摘要: 比赛规则: 1. 采用5局3胜制 2. 前四局采用25分制,每个队只有在赢得至少25分,且同时超过对方2分时才胜一局 3. 决胜局(第五局)采用15分制,先获得15分,且同时超过对方2分为胜 # -*- encoding:utf-8 -*- ''' 模拟排球竞技 ''' # 比赛规则: # 1. 采 阅读全文
posted @ 2021-01-11 16:45 RUNFIFA 阅读(338) 评论(0) 推荐(0)
摘要: import jieba text=open('D:/红楼梦/红楼梦.txt',"r",encoding='utf-8').read() words=jieba.lcut(text) counts={} for word in words: if len(word)==1: #排除带个字符的分词效果 阅读全文
posted @ 2021-01-11 16:43 RUNFIFA 阅读(81) 评论(0) 推荐(0)
摘要: from random import random from time import perf_counter DARTS = 1000*1000*10 hits = 0.0 start = perf_counter() for i in range(1, DARTS+1): x, y = rand 阅读全文
posted @ 2021-01-11 16:42 RUNFIFA 阅读(89) 评论(0) 推荐(0)
摘要: #画国际象棋盘,小格边长为width import turtle turtle.speed(0) width = eval(input()) #画黑格 def drawSquare(width): turtle.pendown() turtle.begin_fill() turtle.fillcol 阅读全文
posted @ 2021-01-11 16:41 RUNFIFA 阅读(90) 评论(0) 推荐(0)
摘要: import turtle number = int(input()) #把用户输入转成整数 turtle.screensize(600,500,'white') turtle.pensize(3) #设置画笔宽度为3 turtle.pencolor('blue') #设置画笔颜色为黑色 turtl 阅读全文
posted @ 2021-01-11 16:26 RUNFIFA 阅读(50) 评论(0) 推荐(0)
摘要: import turtle as tt radius=eval(input()) n=eval(input()) color=input() tt.pencolor(color) tt.goto(0,0) for i in range(n): tt.circle(radius) radius=rad 阅读全文
posted @ 2021-01-11 16:23 RUNFIFA 阅读(82) 评论(0) 推荐(0)
摘要: import turtle turtle.pensize(5) turtle.pencolor("yellow") turtle.fillcolor("red") turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.ri 阅读全文
posted @ 2021-01-11 16:22 RUNFIFA 阅读(157) 评论(0) 推荐(0)
摘要: import turtle as tt tt.setup(450,350,200,200) tt.pensize(2) tt.pencolor("red") tt.fillcolor("purple") for i in range(3): tt.forward(100) tt.right(120) 阅读全文
posted @ 2021-01-11 16:21 RUNFIFA 阅读(104) 评论(0) 推荐(0)
摘要: import turtle turtle.fillcolor("red") turtle.begin_fill() n=1 while n<=5: turtle.forward(200) turtle.right(144) n=n+1 turtle.end_fill() turtle.Turtle( 阅读全文
posted @ 2021-01-11 16:15 RUNFIFA 阅读(68) 评论(0) 推荐(0)