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
51778423
authored
Dec 18, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
83b73772
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
gg.py
nn.py
gg.py
0 → 100644
View file @
51778423
fruit
=
{
"苹果"
:
5
,
"梨子"
:
3
,
"香蕉"
:
4
,
"哈密瓜"
:
4
}
f
=
input
(
"请输入水果名字:"
)
p
=
input
(
"请输入水果的价格"
)
if
f
in
fruit
:
if
int
(
p
)
>
fruit
[
f
]:
print
(
f
+
"涨价了"
)
else
:
print
(
f
+
"降价了"
)
else
:
fruit
[
f
]
=
int
(
p
)
print
(
fruit
)
\ No newline at end of file
nn.py
0 → 100644
View file @
51778423
k
=
{
"小红"
:
78
,
"小明"
:
75
,
"强强"
:
67
,
"大壮"
:
89
}
name
=
input
(
"请输入名字"
)
v
=
input
(
"请输入新的成绩"
)
if
name
in
k
:
if
int
(
v
)
>
k
[
name
]:
k
[
name
]
=
int
(
v
)
print
(
"您的新成绩是"
+
v
)
else
:
print
(
"您的新成绩没有更好哦"
)
else
:
k
[
name
]
=
int
(
v
)
print
(
"您的成绩已经登记"
)
print
(
k
)
\ 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