Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_4
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
13aa06c7
authored
Dec 05, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
13413902
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
61 deletions
diy.s
diy1.py
diy12.py
diy2.py
diy3.py
diy4.py
diy5.py
diy7.py
diy.s
0 → 100644
View file @
13aa06c7
for i in range(2000,3201):
\ No newline at end of file
diy1.py
View file @
13aa06c7
new_data
=
''
import
turtle
with
open
(
r'C:\Users\bellcode\Desktop\myfile2.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
pen
=
turtle
.
Pen
()
for
data
in
file
:
pen
.
hideturtle
()
if
'小鬼:24'
in
data
:
pen
.
fillcolor
(
'green'
)
i
=
i
.
replace
(
'小鬼:24'
,
'小葵:25'
)
pen
.
begin_fill
()
new_data
=
new_data
+
data
pen
.
forward
(
300
)
pen
.
left
(
120
)
with
open
(
r'C:\Users\bellcode\Desktop\myfile2.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
file
:
pen
.
forward
(
450
)
file
=
file
.
write
(
new_data
)
pen
.
left
(
120
)
pen
.
forward
(
450
)
with
open
(
r'C:\Users\bellcode\Desktop\myfile2.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
pen
.
left
(
120
)
a
=
file
.
read
()
pen
.
forward
(
150
)
print
(
a
)
pen
.
left
(
120
)
\ No newline at end of file
pen
.
forward
(
300
)
pen
.
right
(
120
)
pen
.
forward
(
450
)
pen
.
right
(
120
)
pen
.
forward
(
450
)
pen
.
right
(
120
)
pen
.
forward
(
150
)
pen
.
end_fill
()
pen
.
fillcolor
(
'red'
)
pen
.
begin_fill
()
for
i
in
range
(
6
):
pen
.
forward
(
150
)
pen
.
right
(
60
)
pen
.
end_fill
()
turtle
.
done
()
\ No newline at end of file
diy12.py
0 → 100644
View file @
13aa06c7
for
i
in
range
(
2000
,
3201
):
if
i
%
7
==
0
and
i
%
5
!=
0
:
print
(
i
)
\ No newline at end of file
diy2.py
View file @
13aa06c7
num
=
input
(
"请输入所要相加的数字:"
)
import
turtle
num2
=
int
(
input
(
"请输入相加的次数:"
))
pen
=
turtle
.
Pen
()
sum
=
0
pen
.
hideturtle
()
str
=
""
pen
.
speed
(
50
)
for
i
in
range
(
num2
):
pen
.
fillcolor
(
'black'
)
str
=
str
+
num
pen
.
left
(
30
)
sum
=
int
(
str
)
+
sum
for
i
in
range
(
60
):
print
(
sum
)
pen
.
forward
(
150
)
\ No newline at end of file
pen
.
penup
()
pen
.
left
(
180
)
pen
.
pendown
()
pen
.
forward
(
150
)
pen
.
penup
()
pen
.
right
(
178
)
pen
.
pendown
()
pen
.
left
(
180
)
for
i
in
range
(
60
):
pen
.
pendown
()
pen
.
forward
(
30
)
pen
.
penup
()
pen
.
left
(
180
)
pen
.
pendown
()
pen
.
forward
(
30
)
pen
.
penup
()
pen
.
left
(
178
)
pen
.
pendown
()
turtle
.
done
()
\ No newline at end of file
diy3.py
View file @
13aa06c7
str
=
input
(
"请输入三条边:"
)
with
open
(
r'c:\Users\bellcode\Desktop\mydata.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
nums
=
eval
(
str
)
a
=
file
.
read
()
c
=
list
(
nums
)
print
(
a
)
c
.
sort
()
\ No newline at end of file
print
(
c
)
if
c
[
0
]
+
c
[
1
]
>
c
[
2
]:
print
(
"边长{}{}{}能组成三角形"
.
format
(
c
[
0
],
c
[
1
],
c
[
2
]))
if
c
[
0
]
==
c
[
1
]
or
c
[
1
]
==
c
[
2
]:
print
(
"是等腰三角形"
)
elif
c
[
0
]
**
2
+
c
[
1
]
**
2
==
c
[
2
]
**
2
:
print
(
"是直角三角形"
)
else
:
print
(
"是普通三角形"
)
else
:
print
(
"不能组成三角形"
)
diy4.py
View file @
13aa06c7
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
str
(
j
)
+
"×"
+
str
(
i
)
+
"="
+
str
(
j
*
i
)
+
"|"
,
end
=
"
\t
"
)
print
()
\ No newline at end of file
diy5.py
View file @
13aa06c7
import
turtle
as
t
a
=
(
200
**
2
*
2
)
**
0.5
t
.
left
(
90
)
t
.
circle
(
100
,
225
)
t
.
fd
(
a
)
t
.
up
()
t
.
goto
(
0
,
0
)
t
.
fd
(
200
)
t
.
down
()
t
.
left
(
90
)
t
.
circle
(
100
,
225
)
t
.
fd
(
a
)
t
.
done
()
diy7.py
View file @
13aa06c7
with
open
(
r'C:\Users\bellcode\Desktop\myfile.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
file1
:
num
=
int
(
input
(
'请输入一个正整数:'
))
for
i
in
file1
:
for
i
in
range
(
1
,
num
+
1
):
if
'小鬼:24'
in
i
:
print
(
i
,
end
=
''
)
print
(
'数据在txt文件中'
)
\ 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