Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-3
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
9b3434cf
authored
Jan 07, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
86f46bc2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
diy.36
quiz2.py
diy.36
0 → 100644
View file @
9b3434cf
quiz2.py
View file @
9b3434cf
name
=
input
(
"你的名字是:"
)
dict
=
{
'可乐'
:
2
,
'果汁'
:
4
,
'矿泉水'
:
1
}
power
=
input
(
input
(
"你的臂力是:"
))
k
=
input
(
'你买什么'
)
hero
=
[
"赵一"
,
30
,
"丁二"
,
37
,
"孙五"
,
52
,
"王猛"
,
89
,
"周亮"
,
98
,
"张宇"
,
100
]
if
k
in
dict
:
for
i
in
range
(
len
(
hero
)):
print
(
'ok您买的'
+
k
+
'要'
+
dict
[
k
]
+
'块钱'
)
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
\ No newline at end of file
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
p
)
break
print
(
hero
[
-
6
:])
\ 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