Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_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
81edfffd
authored
Jun 23, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
dfcdcd16
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
diy.py
diy1.py
diy2.py
store.py
diy.py
0 → 100644
View file @
81edfffd
name1
=
{
"语文"
:
91
,
"数学"
:
88
,
"英语"
:
85
}
name2
=
{
"语文"
:
90
,
"数学"
:
87
,
"英语"
:
84
}
name3
=
{
"语文"
:
89
,
"数学"
:
86
,
"英语"
:
83
}
score
=
{
"张三"
:
name1
,
"李四"
:
name2
,
"王五"
:
name3
}
name
=
input
(
"请输入人名:"
)
if
name
in
score
:
info
=
score
[
name
]
print
(
"*"
*
30
)
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
print
(
"*"
*
30
)
else
:
print
(
"人名输入错误"
)
diy1.py
0 → 100644
View file @
81edfffd
a
=
[
'华雄'
]
b
=
[
'袁术'
,
'夏侯惇'
,
'曹操'
,
'关羽'
]
b
.
pop
(
3
)
c
=
[
"颜良"
,
"文丑"
]
a
.
extend
(
c
)
print
(
a
)
diy2.py
0 → 100644
View file @
81edfffd
list
=
[
'苹果'
,
'香蕉'
,
'西瓜'
,
'香蕉'
,
'黄瓜'
,
'香蕉'
]
list
.
remove
(
'香蕉'
)
print
(
list
)
\ No newline at end of file
store.py
View file @
81edfffd
goods
=
{
'可口可乐'
:
3
,
'旺仔牛奶'
:
4
,
'农夫山泉'
:
1
,
'辣条'
:
3
,
'巴西烤肉'
:
2
,
'果冻'
:
4
,
'乐事'
:
5
,
'奥利奥'
:
10
,
'巧克力'
:
6
}
goods
.
pop
(
"
农夫山泉
"
)
goods
.
pop
(
"
可口可乐
"
)
print
(
goods
)
# 请将"农夫山泉"删掉,并打印出新的商品信息
# 请将"农夫山泉"删掉,并打印出新的商品信息
\ 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