Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson9_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
ccac0271
authored
Jun 10, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
5ab88987
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
diy2.py
sb.py
xzr.py
diy2.py
View file @
ccac0271
score
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
s1
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
s2
=
{
'语文'
:
999
,
'数学'
:
999
,
'英语'
:
999
}
# 请对字典进行遍历,将保存的分数以键值对的形式提取打印出来
s3
=
{
'语文'
:
666
,
'数学'
:
777
,
'英语'
:
888
}
sb
=
{
"小男孩"
:
s1
,
"大伊万"
:
s2
,
"傻逼"
:
s3
}
while
True
:
print
(
"请输入名字,然后按q"
)
m
=
input
(
'姓名:'
)
if
m
in
sb
:
i
=
sb
[
m
]
for
k
,
v
in
i
.
items
():
print
(
k
,
v
)
elif
m
==
'q'
:
break
else
:
print
(
'错误'
)
print
(
'程序结束'
)
\ No newline at end of file
sb.py
0 → 100644
View file @
ccac0271
xzr.py
0 → 100644
View file @
ccac0271
dict
=
{
'核弹'
:
6754
,
'傻逼'
:
875
,
'武士刀'
:
354
,
'宫本武藏'
:
18888
,
'李信'
:
13888
}
s
=
input
(
"你他妈想要什么:"
)
b
=
input
(
"你他妈要几个:"
)
if
s
in
dict
:
d
=
dict
[
s
]
*
int
(
b
)
print
(
"好的,你的"
+
s
+
"需要支付"
+
str
(
d
)
+
"元"
)
else
:
print
(
"这没你要的东西"
)
\ 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