
python学习
gdpt09
这个作者很懒,什么都没留下…
展开
-
无题 无题
自动卜卦程序,根据曾仕强老先生卜挂教程编写,自动出卦象,解卦需网上自查原创 2021-12-17 14:39:29 · 296 阅读 · 0 评论 -
turtle生成二叉树
import turtle as t # 生成2叉树t.colormode(255)t.penup()t.goto(0,-300)t.pendown()def tree(length, level): #树的层次 if level <= 0: return t.forward(length) #前进方向画length距离 t.left( 45 ) tree( 0.75 * length, level - 1) t.right(.原创 2021-10-18 20:34:13 · 729 阅读 · 0 评论 -
turtle画出PYthon字母
import turtle#Pturtle.pensize(10)turtle.pencolor("blue")turtle.left(90)turtle.fd(100)turtle.right(90)turtle.forward(20)turtle.circle(-26,180)turtle.forward(20)#Yturtle.penup()turtle.goto(80,100)turtle.pendown()turtle.seth(-90)turtle.fd(30).原创 2021-10-18 00:43:48 · 5511 阅读 · 0 评论 -
turtle填充随机颜色同心圆
import turtleimport random#填充随机颜色同心圆turtle.colormode(255)for i in range(9): turtle.fillcolor(random.randint(0,255),random.randint(0,255),random.randint(0,255)) turtle.begin_fill() turtle.circle(180-i*20) turtle.end_fill() turtle.pe.原创 2021-10-18 00:27:26 · 5698 阅读 · 0 评论 -
python字符串操作
1、str.lower() 与str.upper()返回字符串的副本,lower()返回小写,upper() 返回大写 'AbCDefG'.lower() #结果为’abcdefg‘ 'AbCDefG'.upper() #结果为’ABCDEFG’2、str.split(sep=None)返回一个列表,由str根据sep被分隔的部分组成 'A,B,C'.split(',') ...原创 2019-10-22 21:08:36 · 302 阅读 · 0 评论