Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-2
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
bc10d559
authored
Oct 23, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ff2b848c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
diy1.py
quiz.py
wacssf.py
diy1.py
View file @
bc10d559
dict_hero
=
{
'猴三'
:
10
,
'猴一'
:
21
}
print
(
dict_hero
)
print
(
dict_hero
[
'猴三'
])
dict_hero
[
'猴一'
]
=
32
print
(
dict_hero
)
dict_hero
[
'猴十'
]
=
25
print
(
dict_hero
)
s1
=
{
'语'
:
91
,
'数'
:
65
,
'英'
:
85
,}
s2
=
{
'语'
:
94
,
'数'
:
67
,
'英'
:
86
,}
s3
=
{
'语'
:
92
,
'数'
:
68
,
'英'
:
87
,}
score
=
{
'午'
:
s1
,
'四'
:
s2
,
'给'
:
s3
}
name
=
input
(
"名字:"
)
info
=
score
[
name
]
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
\ No newline at end of file
quiz.py
View file @
bc10d559
# 直接运行以下代码,说说你的发现:
list_hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
dict_hero
=
{
'赵一'
:
30
,
'丁二'
:
37
,
'孙五'
:
52
,
'王猛'
:
89
,
'周亮'
:
98
}
print
(
len
(
list_hero
))
print
(
len
(
dict_hero
))
\ No newline at end of file
score
=
{
'语文'
:
120
,
'数学'
:
100
,
'英语'
:
100
}
for
k
,
v
in
score
.
items
():
print
(
k
,
v
)
\ No newline at end of file
wacssf.py
0 → 100644
View file @
bc10d559
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