2020年10月19日

摘要: 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 00:13 佛鑫赵 阅读(48) 评论(0) 推荐(0)

2020年10月11日

摘要: from math import fabs #导入数学模块 from time import perf_counter #导入时间模块 def Bar(i): #动态文本条 N = pow(10,level) a = int((i/N)*50) b = 50 - a Y , N = '*' * a 阅读全文
posted @ 2020-10-11 01:04 佛鑫赵 阅读(93) 评论(0) 推荐(0)

2020年10月8日

摘要: def frog(n): if n <= 2: return n t1, t2 = 1, 2 #1级台阶1种跳法,两级台阶2种跳法 for i in range(3, n+1):#从第三个台阶开始到第n个台阶的跳法 t1, t2 = t2, t1+t2#后一个台阶的跳法=前两个台阶跳法之和 retu 阅读全文
posted @ 2020-10-08 22:35 佛鑫赵 阅读(97) 评论(0) 推荐(0)

2020年9月27日

摘要: #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan import turtle n = 60 # 每行间隔,小格子边长 x = -300 # x初始值 y = -300 # x初始值 def main(): turtle 阅读全文
posted @ 2020-09-27 13:05 佛鑫赵 阅读(425) 评论(0) 推荐(0)
 
摘要: #绘制太极图 from turtle import * setup(800,800,100,100) #绘制左半部分 fillcolor('#FFFFFF') begin_fill() circle(100,180) circle(200,180) seth(180) circle(-100,180 阅读全文
posted @ 2020-09-27 12:59 佛鑫赵 阅读(162) 评论(0) 推荐(0)
 
摘要: #画奥运五环 import turtle coordA=(-100,0,100,-50,70) coordB=(-20,-20,-20,-70,-70) turtle.width(5) turtle.color("red") turtle.penup() turtle.goto(coordA[0], 阅读全文
posted @ 2020-09-27 12:57 佛鑫赵 阅读(176) 评论(0) 推荐(0)
 
摘要: import turtle number = int(input()) turtle.screensize(600,500,'white') turtle.pensize(3) turtle.pencolor('blue') turtle.fillcolor('yellow') turtle.beg 阅读全文
posted @ 2020-09-27 12:43 佛鑫赵 阅读(74) 评论(0) 推荐(0)
 
摘要: import turtle r = int(input("半径:")) count = int(input("同心圆个数:")) color = input("颜色:") import turtle turtle.pensize(4) turtle.pencolor(color) for i in 阅读全文
posted @ 2020-09-27 12:34 佛鑫赵 阅读(336) 评论(0) 推荐(0)

2020年9月21日

摘要: #!/usr/bin/env python # -*- coding:utf-8 -*- from turtle import * ''' 绘制皮卡丘头部 ''' def face(x,y): """画脸""" begin_fill() penup() # 将海龟移动到指定的坐标 goto(x, y 阅读全文
posted @ 2020-09-21 19:27 佛鑫赵 阅读(233) 评论(0) 推荐(0)
 
摘要: def encryption(str, n): cipher = [] for i in range(len(str)): if str[i].islower(): if ord(str[i]) < 123-n: #ord('z')=122 c = chr(ord(str[i]) + n) ciph 阅读全文
posted @ 2020-09-21 13:03 佛鑫赵 阅读(140) 评论(0) 推荐(0)