Commit 6fcd23b6 by BellCodeEditor

auto save

parent 7a6342f1
Showing with 70 additions and 16 deletions
from turtle import *
from random import random
import contextlib
def draw_circle(r):
a, b, c = random(), random(), random()
#pencolor(a, b, c)
fillcolor(a, b, c)
begin_fill()
circle(r)
end_fill()
def pen_skip(step):
penup()
forward(step)
pendown()
speed(5)
setup(width=800,height=600)
screensize(600,400, "gray")
long = 600
high = 450
left(180)
pen_skip(250)
left(90)
pen_skip(200)
left(90)
high_start = 50
high_step = 50
long_start = 50
long_step = 50
for i in range(high_start,high,high_step):
for j in range(long_start,long,long_step):
if (i//high_step)%2 ==1:
if j == long-long_step:
draw_circle(long_step//2)
continue
draw_circle(long_step // 2)
pen_skip(long_step)
else:
if j == long-long_step:
draw_circle(-long_step // 2)
continue
draw_circle(-long_step // 2)
pen_skip(long_step)
if (i//50)%2 == 1:
left(90)
pen_skip(high_step)
left(90)
else:
right(90)
pen_skip(high_step)
right(90)
exitonclick()
username = "python" # username = "python"
userpassword = "123456" # userpassword = "123456"
while True: # while True:
name = input("请输入用户名:") # name = input("请输入用户名:")
password = input("请输入密码:") # password = input("请输入密码:")
if name == username and password == userpassword: # if name == username and password == userpassword:
print("登录成功!") # print("登录成功!")
break # break
if name != username: # if name != username:
print("用户名错误,请重新输入") # print("用户名错误,请重新输入")
elif password !=userpassword: # elif password !=userpassword:
print("密码错误,请重新输入") # print("密码错误,请重新输入")
else: # else:
print("账号、密码生日正确") # print("账号、密码生日正确")
print("欢迎来到贝尔编程!") # print("欢迎来到贝尔编程!")
\ No newline at end of file
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