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
ac3d3b21
authored
May 20, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
f35d3022
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
b.py
diy1.py
b.py
0 → 100644
View file @
ac3d3b21
username
=
"dragon"
password
=
"54088"
user
=
input
(
"请输入用户名"
)
psw
=
input
(
"请输入密码"
)
if
username
==
user
and
password
==
psw
:
print
(
"恭喜你,输对了"
)
else
:
print
(
"恭喜你,输错了"
)
diy1.py
View file @
ac3d3b21
import
random
player
=
input
(
"请出拳:石头/剪刀/布"
)
# 玩家出拳
print
(
"玩家出拳:"
+
player
)
w
=
[
"石头"
,
"剪刀"
,
"布"
]
q
=
random
.
choice
(
w
)
print
(
"机器人出拳"
+
q
)
if
print
in
w
:
print
(
"输入正确"
)
if
player
==
q
:
print
(
"平局"
)
elif
player
==
"石头"
and
q
==
"剪刀"
:
print
(
"玩家赢"
)
elif
player
==
"布"
and
q
==
"石头"
:
print
(
"玩家赢"
)
elif
player
==
"剪刀"
and
q
==
"布"
:
print
(
"玩家赢"
)
else
:
print
(
"输入错误"
)
\ No newline at end of file
username
=
"24520"
password
=
"54188"
while
True
:
user
=
input
(
"请输入用户名:"
)
psw
=
input
(
"请输入密码:"
)
if
user
==
username
and
psw
==
password
:
print
(
"对了"
)
break
else
:
print
(
"错了"
)
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