Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-4
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
a8716394
authored
Jul 11, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
9ed85b40
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
9.py
diy.py
9.py
0 → 100644
View file @
a8716394
student1
=
{
'语文'
:
91
,
'数学'
:
88
,
'英语'
:
85
}
student2
=
{
'语文'
:
97
,
'数学'
:
98
,
'英语'
:
90
}
student3
=
{
'语文'
:
95
,
'数学'
:
100
,
'英语'
:
93
}
score
=
{
'悟空'
:
student1
,
'诺依'
:
student2
,
'小贝'
:
student3
}
name
=
input
(
'名字'
)
if
name
in
score
:
info
=
score
[
name
]
print
(
'*'
*
30
)
for
k
,
v
in
info
.
items
():
print
(
k
,
v
)
else
:
print
(
'*'
*
30
)
print
(
'输入名字有误,退出请按q'
)
\ No newline at end of file
diy.py
View file @
a8716394
# 神奇百货中的物品已经帮你创建好啦,接下来要看你的了~
dict
=
{
'可口可乐'
:
3
,
'旺仔牛奶'
:
4
,
'农夫山泉'
:
1
,
'辣条'
:
3
,
'巴西烤肉'
:
2
,
'果冻'
:
4
,
'乐事'
:
5
,
'奥利奥'
:
10
,
'巧克力'
:
6
}
j
=
input
(
"你要买什么?"
)
if
j
in
dict
:
prink
(
'巧克力'
(
dict
[
j
]))
#dict= {'HK-416-D':1000,'AK-74M':900,'AK-12':1000,'AN-94':999,'格洛克17':100,'AKS74U':500}
#j=input("你要买什么?")
#if j in dict:
# print('AK-74M'+str(dict[j])+"美刀")
# print('HK-416-D'+str(dict[j])+"美刀")
# print('AK-12'+str(dict[j])+"美刀")
# print('AN-94'+str(dict[j])+"美刀")
# print('AKS74U'+str(dict[j])+"美刀")
# print('格洛克17'+str(dict[j])+"美刀")
#else:
# print("老子没这枪!滚一边去!")
score
=
{
'小明'
:
89
,
'明明'
:
98
,
'华强'
:
100
,
"小李"
:
56
,
"王明"
:
92
,
"张磊"
:
87
}
K
=
input
(
"你叫啥?"
)
V
=
input
(
"你考了多少?"
)
if
K
in
score
:
if
int
(
V
)
>
score
[
"score"
]:
score
[
"score"
]
=
int
(
V
)
print
(
K
+
'同学,你的记录已刷新'
)
else
:
print
(
"kvvkhvuf"
)
else
:
else
:
prink
()
score
[
"score"
]
=
int
(
V
)
\ No newline at end of file
print
(
K
+
'同学,你的记录已刷新'
)
\ 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