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
c3516a86
authored
Feb 26, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c43d05da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
3
Untitled-1.py.py
3
0 → 100644
View file @
c3516a86
dict_apple={'苹果':5,'海南香蕉':8,'西瓜':2.68,'榴莲':12,'椰子':10.5,'圣女果':27}
name=input('今天你见了什么水果?')
price=input('How much?')
if name in dict_apple:
if price<dice_apple:
dict_apple['name']=int(price)
print('买买买')
else:
print('明天在看看')
else:
print('我不认识这个水果')
\ No newline at end of file
Untitled-1.py.py
0 → 100644
View file @
c3516a86
while
True
:
dict_apple
=
{
'苹果'
:
5
,
'海南香蕉'
:
8
,
'西瓜'
:
2
,
'榴莲'
:
12
,
'椰子'
:
10
,
'圣女果'
:
27
}
name
=
input
(
'今天你见了什么水果?'
)
price
=
input
(
'How much?'
)
if
name
in
dict_apple
:
if
int
(
price
)
<
dict_apple
[
name
]:
dict_apple
[
name
]
=
int
(
price
)
print
(
'买买买'
)
else
:
print
(
'明天在看看'
)
else
:
dict_apple
[
name
]
=
int
(
price
)
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