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
afbc9be8
authored
Dec 24, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0db28b07
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
2 deletions
01.py
02.py
03.py
04.py
diy.py
01.py
0 → 100644
View file @
afbc9be8
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
hero_name
=
[]
hero_power
=
[]
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
0
:
hero_name
.
append
(
hero
[
i
])
else
:
hero_power
.
append
(
hero
[
i
])
print
(
hero_name
,
hero_power
)
name
=
input
(
"输入名字:"
)
power
=
int
(
input
(
"输入臂力值:"
))
for
i
in
range
(
len
(
hero_power
)):
if
hero_power
[
i
]
>=
power
:
hero_power
.
insert
(
i
,
power
)
hero_name
.
insert
(
i
,
name
)
print
(
hero_name
,
hero_power
)
\ No newline at end of file
02.py
0 → 100644
View file @
afbc9be8
a
=
input
()
a
=
int
(
a
)
print
(
type
(
a
))
l
=
a
*
4
z
=
a
*
a
print
(
"周长"
,
l
)
print
(
"面积"
,
z
)
\ No newline at end of file
03.py
0 → 100644
View file @
afbc9be8
import
turtle
turtle
.
setup
(
600
,
500
,
600
,
300
)
turtle
.
pensize
(
20
)
turtle
.
penup
()
turtle
.
goto
(
-
50
,
100
)
turtle
.
pendown
()
turtle
.
pencolor
(
"red"
)
turtle
.
forward
(
200
)
turtle
.
right
(
135
)
turtle
.
pencolor
(
"green"
)
turtle
.
forward
(
280
)
turtle
.
left
(
135
)
turtle
.
pencolor
(
"blue"
)
turtle
.
forward
(
200
)
turtle
.
penup
()
turtle
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
04.py
0 → 100644
View file @
afbc9be8
print
(
5
*
'A'
)
\ No newline at end of file
diy.py
View file @
afbc9be8
...
...
@@ -8,4 +8,10 @@ for i in range(len(hero)):
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
print
(
hero
)
\ No newline at end of file
print
(
hero
)
# name = input("输入名字:")
# power = input("输入臂力值")
end
=
len
(
hero
)
start
=
end
-
6
print
(
hero
[
start
:])
\ 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