Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson7_1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2a431b9b
authored
Nov 05, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
5cf17bf9
Pipeline
#10961
failed in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
14 deletions
diy1.py
twenty.py
diy1.py
View file @
2a431b9b
students
=
[
"悟空"
,
"小贝"
,
"八戒"
,
"波奇"
]
# 八戒因为要回老家,转学了,请将八戒从班级列表名单中删除
students
.
pop
(
2
)
print
(
students
)
# 班上来了一个新同学,名叫"诺依n",请将"诺依"加入到班级名单里面
students
.
extend
([
"诺依"
])
print
(
students
)
# 班上准备开始辩论赛,分为红(red)、蓝(blue)组,
# 请用切片将班级列表的前2名加入到红组,后2名加入到蓝组
red
=
students
[
0
:
2
]
blue
=
students
[
2
:
4
]
print
(
red
)
print
(
blue
)
# import turtle
# screen=turtle.Screen()
# screen.bgcolor("blue")
#pen=turtle.Pen()
#pen.penup()
#pen.goto(100,-100)
#pen.pendown()
#pen.write("春晓\n春眠不觉晓\n处处闻啼鸟\n夜来风雨声\n花落知多少",font=("Times",20,"normal"))
#pen.hideturtle()
# pen1=turtle.Pen()
# pen1.pensize(5)
# pen1.pencolor("red")
# len=screen.textinput("提示","你需要多大的爱心?")
# lovesize=int(len)
# pen1.left(45)
# pen1.forward(2*lovesize)
# pen1.circle(lovesize,180)
# pen1.right(90)
# pen1.circle(lovesize,180)
# pen1.forward(2*lovesize)
# pen1.hideturtle()
# turtle.done()
username
=
"qwe"
userpassword
=
123456
while
True
:
c
=
input
(
"请输入账号:"
)
d
=
input
(
"请输入密码:"
)
if
username
==
c
and
userpassword
==
d
:
print
(
"登陆成功"
)
break
if
username
!=
c
:
print
(
"账号错误"
)
continue
if
userpassword
!=
d
:
print
(
"密码错误"
)
print
(
"欢迎来到贝尔编程"
)
\ No newline at end of file
twenty.py
0 → 100644
View file @
2a431b9b
# username = "qwe"
# userpassword = 123456
# while True:
# if i = 3:
# c = input("请输入账号:")
# d = input("请输入密码:")
# i-=1
# if username==c and userpassword==d:
# print("登陆成功")
# break
# if username !=c: str
# print("账号错误")
# print("你还有"+str(i)+"次机会")
# continue
# if userpassword !=d:
# print("密码错误")
# print("你还有"+str(i)+"次机会")
# else:
# print("输入错误,机会已用完,请带身份证来我司解锁")
# exit()
# print("欢迎来到贝尔编程")
# import turtle
# pen=turtle.Pen()
# screen=turtle.Screen()
# colrs=["red","orange","yellow","green"]
# for i in range(1,300):
# screen.colr(black)
# pen.colrs(i%4)
# pen.forward(i)
# pen.right(91)
# i+=1
# pen.hideturtle()
# turtle.done()
j
=
1
i
=
1
print
(
j
,
'*'
,
i
,
'='
,(
j
*
i
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment