Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson4_1
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
d4a7acae
authored
Feb 20, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
370cf254
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletions
diy1.py
sb.py
diy1.py
View file @
d4a7acae
...
...
@@ -3,6 +3,6 @@ userpassword = "123456" # 保存在服务器数据库中的用户密码(正
# 请用input()实现用户输入账号、密码的功能
ninxianzaiy
# 如果用户输入的账号、密码正确,提示登陆成功
\ No newline at end of file
sb.py
0 → 100644
View file @
d4a7acae
print
(
"欢迎来到21点!"
)
import
random
_shu_
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
]
_huoqu_
=
random
.
choice
(
_shu_
)
_huoqu2_
=
random
.
choice
(
_shu_
)
print
(
"随机选取点数:"
)
print
(
_huoqu_
)
print
(
"现在拥有点数:"
)
_gg2_
=
0
_gg2_
=
_gg2_
+
_huoqu2_
_gg_
=
0
#刚刚拥有点数
_gg_
=
_gg_
+
_huoqu_
print
(
_gg_
)
print
(
"庄家现有点数:"
)
print
(
_gg2_
)
_aj_
=
0
_aj_
=
input
(
"按“0”提交,或按其他任意键继续。"
)
while
True
:
if
_aj_
==
"0"
:
_huoqu_
=
random
.
choice
(
_shu_
)
_huoqu2_
=
random
.
choice
(
_shu_
)
print
(
"随机选取点数:"
)
print
(
_huoqu_
)
print
(
"现在拥有点数:"
)
_gg2_
=
0
_gg2_
=
_gg2_
+
_huoqu2_
_gg_
=
0
#刚刚拥有点数
_gg_
=
_gg_
+
_huoqu_
print
(
_gg_
)
print
(
"庄家现有点数:"
)
print
(
_gg2_
)
_aj_
=
input
(
"按“0”提交,或按其他任意键继续。"
)
else
:
if
_gg_
==
_gg2_
:
print
(
"平局"
)
break
elif
_gg_
<
_gg2_
:
print
(
"你输了"
)
break
else
:
print
(
"你赢了"
)
break
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