Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-3-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
f398b28c
authored
Mar 19, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
498a7751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
diy1.py
sssss .py
diy1.py
View file @
f398b28c
import
turtle
pen
=
turtle
.
Pen
()
sssss .py
View file @
f398b28c
a
=
input
(
"请出拳(石头、剪刀、布):"
)
print
(
"玩家出"
+
a
)
import
random
b
=
[
"石头"
,
"剪刀"
,
"布"
]
c
=
random
.
choice
(
b
)
print
(
"计算机出拳"
+
c
)
if
a
==
c
:
print
(
"平局"
)
elif
(
a
==
"石头"
and
c
==
"剪刀"
)
or
(
a
==
"布"
and
c
==
"石头"
)
or
(
a
==
"剪刀"
and
c
==
"布"
):
print
(
"你赢了"
)
else
:
print
(
"电脑赢了"
)
i
=
2
userpassword
=
"123456"
username
=
"python"
while
True
:
if
i
>
0
:
name
=
input
(
"请输入用户名:"
)
password
=
input
(
"请输入密码:"
)
i
-=
1
if
name
==
username
and
password
==
userpassword
:
print
(
"登录成功"
)
if
name
!=
username
:
print
(
"用户名错误,请重试"
)
continue
if
password
!=
serpassword
:
print
(
"密码错误,请重试"
)
else
:
print
(
"输入错误2次,你已被锁定"
)
exit
()
print
(
"欢迎来到此地"
)
...
...
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