Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_2
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
db8b0cc3
authored
Jun 08, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
40c6271f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
6 deletions
...py
..py
1.py
diy2.py
m.py
...py
0 → 100644
View file @
db8b0cc3
import
turtle
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"black"
)
pen
=
turtle
.
Pen
()
pen
.
speed
(
0
)
z
=
[
"red"
,
"yellow"
,
"orange"
,
"green"
]
for
i
in
range
(
1
,
500
):
pen
.
color
(
z
[
i
%
4
])
pen
.
forward
(
i
)
pen
.
right
(
91
)
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
..py
0 → 100644
View file @
db8b0cc3
import
turtle
pen
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
-
60
,
-
40
)
pen
.
pendown
()
for
i
in
range
(
4
):
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
penup
()
pen
.
goto
(
100
,
100
)
pen
.
pendown
()
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
pen
.
circle
(
10
)
pen
.
end_fill
()
pen
.
penup
()
pen
.
goto
(
140
,
100
)
pen
.
pendown
()
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
pen
.
color
(
10
)
pen
.
end_fill
()
pen
.
penup
()
pen
.
goto
(
80
,
100
)
pen
.
pendown
()
pen
.
fillcolor
(
"red"
)
pen
.
begin_fill
()
turtle
.
done
()
\ No newline at end of file
1.py
0 → 100644
View file @
db8b0cc3
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
j
,
"×"
,
i
,
"="
,(
i
*
j
),
sep
=
""
,
end
=
" "
)
print
()
\ No newline at end of file
diy2.py
View file @
db8b0cc3
a
=
3
username
=
"python"
userpassword
=
"123456"
while
True
:
name
=
input
(
"请输入用户名:"
)
password
=
input
(
"请输入密码:"
)
if
name
==
username
and
password
==
userpassword
:
print
(
"登录成功!"
)
break
print
(
"用户名和密码错误!请重新输入"
)
if
a
>
0
:
name
=
input
(
"请输入用户名:"
)
password
=
input
(
"请输入密码:"
)
a
-=
1
if
name
==
username
and
password
==
userpassword
:
print
(
"登录成功!"
)
break
if
name
!=
username
:
print
(
"此用户名不存在,请重新输入"
)
print
(
"温馨提示:您还剩"
+
str
(
a
)
+
"次机会"
)
continue
if
password
!=
userpassword
:
print
(
"此密码不存在,请重新输入"
)
else
:
print
(
"账户已锁定"
)
exit
()
print
(
"欢迎来到贝尔编程!"
)
\ No newline at end of file
m.py
0 → 100644
View file @
db8b0cc3
#从前啊,有三个bro,分别是:刘备、关羽、张飞...
bro1
=
"关羽"
bro2
=
"刘备"
bro3
=
"张飞"
#三人来到了桃园准备结义
bros
=
[
"刘备"
,
"关羽"
,
"张飞"
]
bro1
=
[
"关羽"
,
160
,
8.5
]
bro2
=
[
"刘备"
,
161
,
9.1
]
bro3
=
[
"张飞"
,
166
,
8.3
]
bros
[
0
]
=
"关羽"
bros
[
1
]
=
"刘备"
print
(
bros
)
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