Commit df0b1729 by BellCodeEditor

save project

parent faf8dd05
Showing with 51 additions and 0 deletions
"""
使用turtle模块画图
每次移动都增加画笔移动的长度,并旋转91°,重复执行300次,查看效果
"""
import turtle
a=["red","orange","yellow","green","aqua","blue","purple"]
pen = turtle.Pen()
pen.speed(20)
screen=turtle.Screen()
screen.bgcolor("black")
# 请创造师在下面接着创作
for i in range(1,10000,1):
pen.color(a[i%7])
pen.forward(i)
pen.left(360/7+2)
# 隐藏画笔,保存画布
pen.hideturtle()
turtle.done()
\ No newline at end of file
i=10
import turtle
pen=turtle.Pen
turtle.hideturtle()
turtle.bgcolor('light yellow')
username = ['1','2','3','4','5','6','7','8','9','10']
userpassword = ['1','2','3','4','5','6','7','8','9','10']
while True:
if i !=0:
x=0
usernameS=turtle.textinput('登录','请输入username')
for a in range(10):
if username[a] == usernameS:
x=1
break
if x!=1:
pen.write("用户名不存在",font=("times",15,"normal"))
else:
userpasswordS=turtle.textinput('登录','请输入userpassword')
if userpassword[a] == userpasswordS:
pen.write("请输入userpassword",font=("times",15,"normal"))
break
else:
pen.write('密码输入错误',font=("times",15,"normal"))
i-=1
if i !=0:
pen.write('温馨提示:还剩'+str(i)+'次机会',font=("times",15,"normal"))
else:
pen.write('输入次数用完,账户已锁定',font=("times",15,"normal"))
turtle.done()
exit()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment