世间如此美好,有那么多有意思的事情等着你去体验,即便是一串代码,也能给人带来意想不到的快乐。
import turtle as t #导入 turtle 模块并命名为 t
from random import choice #导入choice模块
def gaoxiao():
c=input("请输入密码:")
if c == "123456":
print("正确")
else:
for n in range(100):
t.bgcolor("blue") #幕布颜色
t.color("red") #画笔颜色
t.speed(500)
x = list(range(-800, 800)) #设一个长度为1600的x轴
y = list(range(-400, 400)) #设一个长度为1600的y轴
x1 = choice(x) #随即在x轴上取一点
y1 = choice(y) #随即在y轴上取一点
t.penup()
t.goto(x1,y1) #抬起画笔前往这个点
for i in range(1) :
t.pendown()
m=list(range(10,50))
m1=choice(m)
t.write("错误",font=("隶书",m1)) #设置写的内容 和 字体的格式
t.hideturtle()
t.done()
gaoxiao()