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
40f76b97
authored
Jul 06, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
203d4c8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
6 deletions
diy1.py
diy1.py
View file @
40f76b97
...
@@ -9,11 +9,100 @@
...
@@ -9,11 +9,100 @@
# break
# break
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
hp
=
{
'可乐'
:
9
,
'薯片'
:
10
,
'奥利奥'
:
5
,
'肉松'
:
3
,
'尖叫'
:
6
}
# hp={'可乐':9,'薯片':10,'奥利奥':5,'肉松':3,'尖叫':6}
k
=
input
(
"你要啥东东?"
)
# k=input("你要啥东东?")
if
k
in
hp
:
# if k in hp:
print
(
"叮咚,您要买的东西"
+
k
+
"需要支付"
+
str
(
hp
[
k
])
+
"元"
)
# print("叮咚,您要买的东西"+k+"需要支付"+str(hp[k])+"元")
else
:
# else:
print
(
"神奇百货没有,哪凉快哪待着去"
)
# print("神奇百货没有,哪凉快哪待着去")
fs
=
{
'张仕昕'
:
10
,
'张雨馨'
:
85
,
'王宣老师'
10
,
'杨师轩'
:
80
}
k
=
input
(
"请输入你的姓名:"
)
v
=
input
(
"请输入你的成绩:"
)
if
k
in
fs
:
if
int
(
v
)
>
fs
[
k
]:
fs
[
k
]
=
int
(
v
)
print
(
"恭喜"
+
k
+
"你的成绩已更新为+v+“分"
)
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