Commit af32a382 by BellCodeEditor

auto save

parent 370cf254
Showing with 57 additions and 6 deletions
for i in range(0,10,5): #前闭后开区间
print(i)
import turtle #导入画图模块
pen1=turtle.Pen() #创建画笔
screen=turtle.Screen() #创建画布
screen.bgcolor("black")#设置画布颜色
list1=["red","orange","yellow","green"] #创建列表记录颜色
pen1.speed(0) #设置画笔速度
for i in range(1,300): #用i作为变量记录边长,循环300次,边长自增1
pen1.pencolor(list1[i%4]) #设置画笔颜色
pen1.forward(i) #画边长
pen1.right(91)#旋转指定角度
pen1.hideturtle() #隐藏画笔
turtle.done() #保留画布
import turtle
pen1=turtle.Pen()
screen=turtle.Screen()
screen.bgcolor("black")
colors=["green","red","orange","yellow"]
pen1.speed(0)
for i in range(1,300):
pen1.pencolor(colors[i%4])
pen1.forward(i)
pen1.right(91)
pen1.hideturtle()
turtle.done()
i=1 #列
j=1 #行
for i in range(1,10):
for j in range(1,i+1): #i+1实现不重复效果
print(j,"X",i,"=",j*i,end=" ")
print() #换行
username = "python" # 保存在服务器数据库中的用户账号(正确的账号) username = "python" # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码) userpassword = "123456" # 保存在服务器数据库中的用户密码(正确的密码)
i = 3 #i表示有3次输入机会
# 用input()实现用户输入账号、密码的功能
while True:
if i > 0:
name = input("请输入账号:")
password = input("请输入密码:")
i-=1 #输入次数每次减一
# 如果用户输入的账号、密码正确,提示登陆成功
if name== username and password == userpassword:
print("登陆成功")
break #账号密码正确 跳出循环
if name != username:
print("账号不存在,请重新输入!")
print("温馨提示:您还有"+str(i)+"次登录机会")
continue #账号输错、密码就不用再输入了
if password != userpassword:
print("密码输入错误,请重新输入!")
print("温馨提示:您还有"+str(i)+"次登录机会")
else: #输入次数用完 提示
print("你的账户已被锁定,请带身份证来我司解锁")
exit() #结束程序
print("欢迎来到贝尔编程")
# 请用input()实现用户输入账号、密码的功能
# 如果用户输入的账号、密码正确,提示登陆成功
\ 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