Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-5-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
27a66314
authored
Sep 05, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4d8b6805
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
1 deletions
diy.py
diy2.py
diy3.py
diy4.py
diy5.py
diy.py
View file @
27a66314
...
...
@@ -3,11 +3,17 @@
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
# 问询处
a
=
input
(
"姓名:"
)
b
=
int
(
input
(
"臂力值:"
))
# 归档处
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
,
'张宇'
,
100
]
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
>
b
:
hero
.
insert
(
i
-
1
,
a
)
hero
.
insert
(
i
,
b
)
break
print
(
hero
[
-
6
:])
...
...
diy2.py
0 → 100644
View file @
27a66314
# yuan=(2,3,1,4,6,5)
# print(type(yuan))
# list1=sorted(yuan)
# print(list1)
import
turtle
turtle
.
color
(
'red'
)
turtle
.
fillcolor
(
"yellow"
)
turtle
.
begin_fill
()
turtle
.
circle
(
200
,
steps
=
6
)
turtle
.
end_fill
()
turtle
.
done
()
\ No newline at end of file
diy3.py
0 → 100644
View file @
27a66314
import
turtle
def
draw
(
x
,
y
,
ys
):
turtle
.
goto
(
x
,
y
)
turtle
.
pendown
()
turtle
.
pensize
(
20
)
turtle
.
pencolor
(
ys
)
turtle
.
circle
(
50
)
turtle
.
penup
()
draw
(
0
,
0
,
"black"
)
draw
(
-
130
,
0
,
"blue"
)
draw
(
130
,
0
,
"red"
)
draw
(
-
70
,
-
60
,
"yellow"
)
draw
(
70
,
-
60
,
"green"
)
turtle
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
diy4.py
0 → 100644
View file @
27a66314
a
=
[
19
,
28
,
30
,
35
,
39
,
42
,
48
]
key
=
int
(
input
())
i
,
j
=
0
,
len
(
a
)
-
1
kk
=-
1
while
i
<
j
:
m
=
(
i
+
j
)
//
2
if
a
[
m
]
==
key
:
kk
=
m
break
if
a
[
m
]
>
key
:
j
=
m
-
1
print
(
1
,
m
)
else
:
i
=
m
+
1
print
(
2
,
m
)
if
a
[
m
]
>
key
:
kk
=
kk
-
1
else
:
kk
=
kk
+
1
if
a
[
kk
]
==
key
:
print
(
"找到了"
+
str
(
key
)
+
"在{}"
.
format
(
kk
))
else
:
print
(
"没找到!"
)
diy5.py
0 → 100644
View file @
27a66314
print
(
9
//
2
)
\ 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