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
03a104c4
authored
Sep 12, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
05e48008
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
quiz.py
quiz.py
View file @
03a104c4
# 直接运行以下代码,说说你的发现:
dict_hero
=
{
'赵一'
:
30
,
'丁二'
:
37
,
'孙五'
:
52
,
'王猛'
:
89
,
'周亮'
:
98
}
dict_hero
[
'赵一'
]
=
10
print
(
dict_hero
)
dict_hero
=
{
'可乐'
:
30
,
'薯片'
:
37
,
'奥利给'
:
52
,
'卫生纸'
:
89
}
t
=
input
(
"你要啥"
)
if
t
in
dict_hero
:
print
(
'你需要的'
+
t
+
str
(
dict_hero
[
t
])
+
'元'
)
else
:
print
(
"没有,你可以滚了"
)
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