<<--B站..........欢迎来到DGX的博客..........GitHub-->>

我的B站
上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 1 from random import random 2 from time import perf_counter 3 from tqdm import tqdm 4 import time 5 for i in tqdm(range(100)): 6 time.sleep(0.1) 7 pri 阅读全文
posted @ 2020-04-15 15:23 DG息 阅读(205) 评论(0) 推荐(0)
摘要: 运用jieba库统计词频,并对词频进行排序 1 import jieba 2 txt = open("文章.txt","r",encoding='gbk',errors='replace').read() 3 words = jieba.lcut(txt) 4 counts = {} 5 for w 阅读全文
posted @ 2020-04-15 15:19 DG息 阅读(309) 评论(0) 推荐(0)
摘要: 实现和线上汉诺塔移动问题 1 def hannuo(n,a,b,c): 2 if n == 1: 3 print(a,"->",c) 4 else: 5 hannuo(n-1,a,c,b)#将最后一个盘子移到c 6 print(a,"->",c)#将剩余的盘子移动c 7 hannuo(n-1,b,a 阅读全文
posted @ 2020-04-15 15:15 DG息 阅读(335) 评论(0) 推荐(0)
摘要: 一元二次方程求根 一元二次方程ax2+bx+c=0,a、b、c的值由用户在三行中输入,根据用户输入的数值求解方程的实数解:‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‭‬‪‬‪‬‪‬‪‬‪ 阅读全文
posted @ 2020-04-15 01:14 DG息 阅读(6018) 评论(0) 推荐(0)
摘要: 1 import turtle 2 for i in range(8): #一共有八列 3 for j in range(8):#每一行有八个格 4 turtle.forward(37.5) 5 if j % 2 == 0:#判断是否为第奇数个格(是否画黑色格) 6 7 if i % 2 ==0:# 阅读全文
posted @ 2020-04-01 13:08 DG息 阅读(337) 评论(0) 推荐(0)
摘要: 1 #太极的简单画法https://www.cnblogs.com/yeu4h3uh2/ 2 import turtle as t 3 t.begin_fill() #用于填充阴鱼的颜色,从begin_fill开始到end_fill之间画的区域全部填充 4 t.seth(180) 5 t.circl 阅读全文
posted @ 2020-04-01 13:06 DG息 阅读(424) 评论(0) 推荐(0)
摘要: 1 import turtle 2 turtle.setup(600,400,500,200) 3 turtle.pensize(2) 4 color1=['red','blue','green','yellow','black'] 5 i=0 6 coordA=(-110,0,110,-55,55 阅读全文
posted @ 2020-03-18 01:57 DG息 阅读(605) 评论(0) 推荐(0)
摘要: 1 import turtle 2 turtle.screensize(800,800,"red") 3 turtle.setup(800,500,100) 4 turtle.penup() 5 turtle.fd(-100) 6 turtle.pendown() 7 turtle.pensize( 阅读全文
posted @ 2020-03-18 00:25 DG息 阅读(1200) 评论(0) 推荐(0)
摘要: 1 import turtle 2 a=int(input()) 3 turtle.setup(600,400,500,200) 4 turtle.pensize(2) 5 turtle.color("blue") 6 turtle.fillcolor("yellow") 7 i=3 8 while 阅读全文
posted @ 2020-03-18 00:19 DG息 阅读(1639) 评论(0) 推荐(0)
摘要: 1 '''方法一 2 from turtle import * 3 setup(600,400,500,200) 4 color("red") 5 pensize(2) 6 circle(20) 7 for i in range(1,4): 8 penup() 9 goto(0,-10*i) 10 阅读全文
posted @ 2020-03-17 21:55 DG息 阅读(2221) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 下一页