Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-2
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
73f7b332
authored
Nov 27, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ff9d3f49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
quiz.py
quiz.py
View file @
73f7b332
# 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢?
hero
=
[
'美眉'
,
10
,
'美眉2'
,
20
,
'美眉3'
,
30
,
'美眉4'
,
40
,
'美眉5'
,
50
]
list
=
[
'苹果'
,
'香蕉'
,
'西瓜'
,
'香蕉'
,
'桃子'
,
'香蕉'
]
name
=
'王胜'
list
.
remove
(
'香蕉'
)
power
=
25
print
(
list
)
while
True
:
\ No newline at end of file
name
=
input
(
'输入你想要的美眉:'
)
if
(
name
==
'q'
):
break
power
=
int
(
input
(
'输入你理想美眉的分数:'
))
for
i
in
range
(
len
(
hero
)):
if
(
i
%
2
!=
0
and
hero
[
i
]
>=
power
):
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
break
else
:
hero
.
extend
([
name
,
power
])
print
(
hero
[
-
1
:
-
7
:
-
1
])
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