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
01c611b9
authored
Feb 04, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
5a95e81e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
diy.py
jntm.py
l.py
m.py
diy.py
deleted
100644 → 0
View file @
5a95e81e
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
name
=
input
(
'叫啥?'
)
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
print
(
hero
[
-
6
:])
\ No newline at end of file
jntm.py
0 → 100644
View file @
01c611b9
def
new_input
()
:
total
=
[]
while
True
:
unit
=
input
(
'请输入:'
)
if
unit
==
'q'
:
break
else
:
try
:
unit
=
int
(
unit
)
except
:
print
(
"请重新输入一个数字"
)
else
:
total
.
append
(
unit
)
finally
:
print
(
"============================="
)
return
total
def
sum
(
money
):
co
\ No newline at end of file
l.py
0 → 100644
View file @
01c611b9
text
=
[
"p"
,
"y"
,
"t"
,
"h"
,
"o"
,
"n"
]
new_text
=
""
.
join
(
text
)
print
(
new_text
)
\ No newline at end of file
m.py
0 → 100644
View file @
01c611b9
import
func
date
=
func
.
new_input
()
score
=
func
.
sum
(
data
)
print
(
'这位选手的总分数为:'
+
str
(
score
))
\ 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