Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-1-1_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
528d26db
authored
Dec 17, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c74d2d63
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
49 deletions
aa.py
diy
diy6.py
diy7.py
aa.py
View file @
528d26db
# 利用write()帮助悟空给诺依回信吧~
import
turtle
screen
=
turtle
.
Screen
()
len
=
screen
.
textinput
(
"大小"
,
"你想要多大的爱心"
)
size
=
int
(
len
)
pen
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
100
,
-
100
)
pen
.
write
(
"你好
\n
诺依."
,
font
=
(
"Times"
,
30
,
"normal"
))
pen
.
hideturtle
()
pen1
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
100
,
-
100
)
pen1
.
left
(
45
)
pen1
.
forward
(
size
*
2
)
pen1
.
circle
(
size
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
size
,
180
)
pen1
.
forward
(
size
*
2
)
screen
.
bgcolor
(
"blue"
)
turtle
.
done
()
diy
0 → 100644
View file @
528d26db
diy6.py
0 → 100644
View file @
528d26db
username
=
"python"
userpassword
=
"123456"
while
True
:
name
=
input
(
"用户名:"
)
password
=
input
(
"密码:"
)
if
username
==
name
and
userpassword
==
password
:
print
(
"登录成功"
)
break
elif
username
!=
name
:
print
(
"用户名错误!请重新输入!"
)
else
:
print
(
"密码错误!请重新输入!"
)
print
(
"欢迎来到贝尔编程"
)
\ No newline at end of file
diy7.py
0 → 100644
View file @
528d26db
i
=
3
username
=
"python"
userpassword
=
"123456"
while
True
:
if
i
>
0
:
name
=
input
(
"用户名:"
)
password
=
input
(
"密码:"
)
if
username
==
name
and
userpassword
==
password
:
print
(
"登录成功"
)
break
if
username
!=
name
:
print
(
"用户名错误!请重新输入!"
)
continue
if
userpassword
!=
password
:
print
(
"密码错误!请重新输入!"
)
i
-=
1
else
:
print
(
"你的账户已锁定,请来我司解锁。"
)
exit
()
print
(
"欢迎来到贝尔编程"
)
\ 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