Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson13-diy1
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
08bab30f
authored
Jun 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
8b90b8d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
diy1.py
diy2.py
diy3.py
diy1.py
View file @
08bab30f
import
time
as
a
import
time
start_time
=
time
.
time
()
print
(
"开始时间为:"
,
start_time
)
for
i
in
range
(
0
,
1001
):
\ No newline at end of file
for
a
in
range
(
0
,
1001
):
for
b
in
range
(
0
,
1001
):
for
c
in
range
(
0
,
1001
):
if
a
**
2
+
b
**
2
==
c
**
2
:
print
(
"a,b,c的值分别为:"
,
a
,
b
,
c
)
end_time
=
time
.
time
()
print
(
"结束时间为:"
,
end_time
)
diy2.py
0 → 100644
View file @
08bab30f
import
time
list
=
[]
start_time
=
time
.
time
()
for
a
in
range
(
0
,
1001
):
for
b
in
range
(
0
,
1001
):
#list.insert(1,0)
list
.
append
(
0
)
end_time
=
time
.
time
()
time
=
end_time
-
start_time
print
(
":"
,
time
)
\ No newline at end of file
diy3.py
0 → 100644
View file @
08bab30f
abc
=
[
20
,
17
,
9
,
13
,
5
,
6
]
n
=
len
(
abc
)
for
j
in
range
(
0
,
5
):
if
abc
[
a
]
>
abc
[
a
+
1
]:
abc
[
a
],
abc
[
a
+
1
]
\ 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