Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-3
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
5338e863
authored
Aug 19, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
5d2aefb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
quiz.py
quiz.py
View file @
5338e863
dict
=
{
"一"
:
3
,
"二"
:
4
,
"三"
:
5
,
"四"
:
6
,
"五"
:
7
}
k
=
input
(
"请输入你的姓名"
)
v
=
input
(
"请输入你的分数"
)
dict
=
{
"可乐"
:
3
,
"雪碧"
:
4
,
"薯片"
:
5
,
"薯条"
:
6
,
"果汁"
:
7
}
k
=
input
(
"你想买什么?"
)
if
k
in
dict
:
if
int
(
v
)
>
dict
[
k
]:
dict
[
k
]
=
int
(
v
)
print
(
"亲爱的"
+
k
+
"同学恭喜你分数更新为"
+
v
)
print
(
"你购买的商品是"
+
k
+
"你需要支付"
+
str
(
dict
[
k
]))
else
:
dict
[
k
]
=
int
(
v
)
print
(
"亲爱的"
+
k
+
"同学你你的第一次分数为分数更新为"
+
v
)
\ No newline at end of file
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