Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson12-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
45306e02
authored
2 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
9fb91e53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
5 deletions
11/1.py
2.py/2.py
diy.py
uteyigbyy7.py
11/1.py
0 → 100644
View file @
45306e02
with
open
(
r"C:\Users\mk-18\Desktop\book.txt"
,
'w'
,
encoding
=
'utf-8'
)
as
file1
:
file1
.
write
(
'小丽:11本
\n
'
)
file1
.
write
(
'李雯:9本
\n
'
)
file1
.
write
(
'张伟:16本
\n
'
)
new_data
=
''
with
open
(
r"C:\Users\mk-18\Desktop\book.txt"
,
'r'
,
encoding
=
'utf-8'
)
as
file1
:
for
data
in
file1
:
if
'李雯:9本'
in
data
:
data
=
data
.
replace
(
'李雯:9本'
,
'李雯:10本'
)
if
'小丽:11本'
in
data
:
data
=
data
.
replace
(
'小丽:11本'
,
'小丽:14本'
)
new_data
+=
data
with
open
(
r"C:\Users\mk-18\Desktop\book.txt"
,
'w'
,
encoding
=
'utf-8'
)
as
file1
:
file1
.
write
(
new_data
)
with
open
(
r"C:\Users\mk-18\Desktop\book.txt"
,
'r'
,
encoding
=
'utf-8'
)
as
file1
:
a
=
file1
.
read
()
print
(
a
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
2.py/2.py
View file @
45306e02
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
j
,
'*'
,
i
,
'='
,(
j
*
i
),
end
=
''
)
print
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
diy.py
View file @
45306e02
import
turtle
pen
=
turtle
.
Pen
()
pen
.
pencolor
(
"pink"
)
pen
.
pensize
(
10
)
pen
.
fillcolor
(
"yellow"
)
pen
.
penup
()
pen
.
goto
(
100
,
-
100
)
pen
.
pendown
()
pen
.
left
(
90
)
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
pendown
()
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
pendown
()
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
pendown
()
pen
.
forward
(
200
)
pen
.
penup
()
pen
.
penup
()
pen
.
pencolor
(
"purple"
)
pen
.
goto
(
0
,
-
50
)
pen
.
pendown
()
pen
.
fillcolor
(
"blue"
)
pen
.
begin_fill
()
pen
.
circle
(
50
)
pen
.
end_fill
()
turtle
.
done
()
This diff is collapsed.
Click to expand it.
uteyigbyy7.py
0 → 100644
View file @
45306e02
import
turtle
p
=
turtle
.
Pen
()
p
.
pensize
(
3
)
p
.
pencolor
(
"blue"
)
p
.
fillcolor
(
"pink"
)
p
.
begin_fill
()
p
.
goto
(
0
,
0
)
p
.
goto
(
0
,
100
)
p
.
goto
(
100
,
100
)
p
.
goto
(
100
,
0
)
p
.
goto
(
0
,
0
)
p
.
end_fill
()
turtle
.
done
()
This diff is collapsed.
Click to expand it.
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