Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson23-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
b98bcf8f
authored
Mar 29, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
d375c6ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
my_csv.py
scores.csv
my_csv.py
View file @
b98bcf8f
import
csv
import
csv
whth
open
(
"reporot.csv"
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
data
=
[[
"姓名"
,
"语文"
,
"数学"
,
"英语"
]
f_csv
=
csv
.
reader
(
f
)
,[
"小贝"
,
98
,
99
,
92
]
f_csv
=
list
(
f_csv
)
,
[
"聪聪"
,
95
,
91
,
95
]
]
pipi
=
f_csv
[
7
]
with
open
(
"scores.csv"
,
"w"
,
encoding
=
"utf-8"
,
newline
=
""
)
as
csvfile
:
print
(
pipi
)
writher
=
csv
.
writer
(
csvfile
)
for
row
in
f_csv
:
writher
.
writerows
(
data
)
print
(
row
[
3
]
)
\ No newline at end of file
scores.csv
View file @
b98bcf8f
姓名,语文,数学,英语
小贝,98,99,92
聪聪,95,91,95
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