Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-2_DIY1
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
e43d8d20
authored
Mar 25, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c0a16e44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
3 deletions
diy2.py
diy3.py
diy4.py
diy5.py
diy2.py
View file @
e43d8d20
#倒入模块
#倒入模块
import
turtle
import
turtle
screen
=
turtle
.
Screen
()
len
=
screen
.
textinput
(
"提示"
,
"你要多大地爱心?"
)
lovesize
=
int
(
len
)
#pen.penup()
#pen.goto(100,-100)
#创建画笔
#创建画笔
pen
=
turtle
.
Pen
()
#
pen=turtle.Pen()
#写字
#写字
pen
.
write
(
"傻逼,快点画"
,
font
=
(
"Times"
,
30
,
"normal"
))
#隐藏画笔
#隐藏画笔
pen
.
hideturtle
()
#
pen.hideturtle()
#保存画布
#保存画布
#turtle.done()
penl
=
turtle
.
Pen
()
penl
.
pensize
(
5
)
penl
.
pencolor
(
"red"
)
pen1
.
left
(
45
)
penl
.
forward
(
2
*
lovesize
)
penl
.
circle
(
lovesize
,
180
)
penl
.
right
(
90
)
penl
.
circle
(
lovesize
,
180
)
penl
.
forward
(
2
*
lovesize
)
penl
.
hideturtle
()
turtle
.
done
()
turtle
.
done
()
\ No newline at end of file
diy3.py
0 → 100644
View file @
e43d8d20
i
=
3
username
=
"齐天小圣"
userpassword
=
"123456"
while
True
:
if
i
>
0
:
name
=
input
(
"请输入用户名:"
)
password
=
input
(
"请输入密码:"
)
i
-=
1
if
name
==
username
and
password
==
userpassword
:
print
(
"登陆成功!"
)
break
if
name
!=
username
:
print
(
"用户名不存在!"
)
continue
if
password
!=
userpassword
:
print
(
"密码错误,请重新输入!"
)
else
:
print
(
"你的账号已被锁定"
)
exit
()
print
(
"欢迎来到贝尔编程!"
)
\ No newline at end of file
diy4.py
0 → 100644
View file @
e43d8d20
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
j
,
'*'
,
i
,
'*'
,(
j
*
i
),
end
=
" "
)
print
()
\ No newline at end of file
diy5.py
0 → 100644
View file @
e43d8d20
bro1
=
"关羽"
bro2
=
"刘备"
dro3
=
"张飞"
bros
=
[
"刘备"
,
"关羽"
,
"张飞"
]
brol
=
[
"关羽"
,
160
,
8
,
5
]
bro2
=
[
"刘备"
,
161
,
9
,
1
]
bro3
=
[
"张飞"
,
166
,
8
,
3
]
bros
[
0
]
=
"刘备"
bros
[
1
]
=
"关羽"
print
(
bros
)
\ 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