Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-5-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
602d3bc7
authored
Jun 06, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
6d2eb407
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
123.py
diy.py
123.py
0 → 100644
View file @
602d3bc7
students
=
[
"悟空"
,
"小贝"
,
"八戒"
,
"波奇"
]
students
.
pop
(
2
)
students
.
append
(
"诺依"
)
print
(
students
)
red
=
students
[
0
:
2
]
blue
=
students
[
2
:
5
]
print
(
red
)
print
(
blue
)
diy.py
View file @
602d3bc7
# 臂力挑战赛
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
name
=
'刘强'
name
=
input
(
"你叫啥"
)
a
=
'是臂力大王。'
a
=
'是臂力大王。'
power
=
66
power
=
int
(
input
(
"你臂力多少"
))
hero
=
[
'
周亮'
,
98
,
'王猛'
,
89
,
'孙五'
,
52
,
'丁二'
,
37
,
'赵一'
,
30
]
hero
=
[
'
赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
# 自动排序
# 自动排序
for
i
in
range
(
len
(
hero
)):
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
<
=
power
:
if
i
%
2
==
1
and
hero
[
i
]
>
=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
hero
.
insert
(
i
,
power
)
break
break
hero
.
insert
(
6
,
a
)
hero
.
append
(
a
)
print
(
hero
[
0
:
7
])
print
(
hero
[
-
7
:])
name
=
input
(
"你叫啥"
)
a
=
'是臂力大王。'
power
=
int
(
input
(
"你臂力多少"
))
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
# 自动排序
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
break
hero
.
append
(
a
)
print
(
hero
[
-
7
:])
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