Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-1
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
40280b2b
authored
Dec 11, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
f3fb05e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
c.py
diy2.py
diy3,py
c.py
View file @
40280b2b
dict
=
{
"我"
:
1
,
"你"
:
2
,
"他"
:
3
}
print
(
dict
[
"我"
])
dict
[
"我"
]
=
11
dict
[
"z"
]
=
12
if
z
in
dict
:
dict
=
{
"小明"
:
30
,
"小李"
:
60
,
"小美"
:
100
}
k
=
input
(
"您的姓名是什么"
)
j
=
input
(
"您的最新成绩是什么"
)
if
k
in
dict
:
if
int
(
j
)
>
dict
[
k
]:
print
(
"您的成绩已刷新"
)
else
:
print
(
"您的成绩未刷新"
)
else
:
dict
[
k
]
=
v
print
(
dict
)
print
(
"您的第一次成绩已刷新"
)
diy2.py
0 → 100644
View file @
40280b2b
dict
=
{
"农夫山泉"
:
2
,
"旺仔牛奶"
:
3
,
"可口可乐"
:
3
,
"巧克力"
:
3
,
"乐事"
:
4
,
"奥利奥"
:
5
,
"巴西烤肉"
:
5
}
k
=
input
(
"你想买什么?"
)
j
=
input
(
"你想买的数量是什么?"
)
if
k
in
dict
:
print
(
"你的"
+
k
+
"需要"
+
str
(
dict
[
k
])
*
str
(
dict
[
j
])
+
"元"
)
else
:
print
(
"没有货"
)
diy3,py
0 → 100644
View file @
40280b2b
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