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
80e9060d
authored
Nov 20, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
2319fca5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
a.py
diy.py
a.py
View file @
80e9060d
dict
=
{
"可乐"
:
3
,
"咖啡"
:
6
,
"牛奶"
:
4
,
"冰红茶"
:
3.5
,
"奶茶"
:
5
,
"矿泉水"
:
1
,
"脉动"
:
4.5
}
dict
=
{
"可乐"
:
3
,
"咖啡"
:
6
,
"牛奶"
:
4
,
"冰红茶"
:
3.5
,
"奶茶"
:
5
,
"矿泉水"
:
1
,
"脉动"
:
4.5
}
k
=
input
(
"请输出你想买得饮料"
)
k
=
input
(
"请输出你想买得饮料"
)
if
k
in
dict
:
if
k
in
dict
:
...
...
diy.py
View file @
80e9060d
dict
=
{
"可乐"
:
3
,
"咖啡"
:
6
,
"牛奶"
:
4
,
"冰红茶"
:
3.5
,
"奶茶"
:
5
,
"矿泉水"
:
1
,
"脉动"
:
4.5
}
k
=
input
(
"请输出饮料名称"
)
v
=
input
(
"请输出饮料价钱"
)
if
k
in
cost
:
if
float
(
v
)
<
cost
[
k
]:
cost
[
k
]
=
float
(
v
)
print
(
"好的,"
+
k
+
"现在"
+
v
+
"元"
)
else
:
print
(
"好的,"
+
k
+
"现在"
+
v
+
"元"
)
else
:
cost
[
k
]
=
float
(
v
)
print
(
k
+
'的价钱'
+
v
+
'元已上传~~~'
)
\ 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