Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-5
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
5e7babeb
authored
Dec 15, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
b90a3eaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
mama.py
mama.py
0 → 100644
View file @
5e7babeb
fruit
=
{
"苹果"
:
3.5
,
"香蕉"
:
5
,
"西瓜"
:
10
}
while
True
:
today_fruit
=
input
(
"输入水果:"
)
today_price
=
input
(
"输入今日价格:"
)
if
today_fruit
in
fruit
:
if
float
(
today_price
)
<
fruit
[
today_fruit
]:
print
(
"水果降价了,之前的价格是"
+
str
(
fruit
[
today_fruit
]))
else
:
print
(
"涨价了,我们不卖"
)
else
:
fruit
[
today_fruit
]
=
float
(
today_price
)
print
(
"您添加了"
+
today_fruit
+
"价格是"
+
today_price
)
\ 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