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
7339f3dc
authored
Sep 06, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
8c623bfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
996 deletions
diy1.py
diy4.py
diy8.py
quiz.py
diy1.py
View file @
7339f3dc
...
...
@@ -7,998 +7,4 @@ if '猴一' in dict_hero:
print
(
'yes'
)
else
:
print
(
'no'
)
print
(
dict_hero
)
print
(
s
)
print
(
dict_hero
)
\ No newline at end of file
diy4.py
0 → 100644
View file @
7339f3dc
qp
=
{
'小明'
:
82
,
'小王'
:
86
,
'小张'
:
58
,
'小美'
:
100
,
'丁一'
:
42
}
xm
=
input
(
'请输入您的姓名:'
)
cj
=
input
(
'请输入你的最新成绩:'
)
if
xm
in
qp
:
if
int
(
cj
)
>
qp
[
xm
]:
print
(
'亲爱的'
+
xm
+
'同学,恭喜您~成绩已更新为'
+
cj
+
'分!'
)
else
:
print
(
'亲爱的'
+
xm
+
'同学,遗憾的通知您,成绩未被刷新。'
)
else
:
qp
[
xm
]
=
int
(
cj
)
print
(
'亲爱的'
+
xm
+
'同学,您的第一次成绩'
+
cj
+
'已上传'
)
\ No newline at end of file
diy8.py
0 → 100644
View file @
7339f3dc
sbhbd
=
{
'汉杯儿杯儿'
:
5
,
'老八小汉杯儿'
:
90
,
'奥利给小饼干'
:
100
,
'利奥利'
:
1
,
'汪仔牛奶糖'
:
0.1
,
'老八'
:
10000
}
v
=
input
(
'您要买什么'
)
if
v
in
sbhbd
:
print
(
'叮咚~您的'
+
v
+
'需要支付'
+
str
(
sbhbd
[
v
])
+
'元'
)
else
:
print
(
'您要的商品已经卖完'
)
\ No newline at end of file
quiz.py
View file @
7339f3dc
# 直接运行以下代码,说说你的发现:
list_hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
dict_hero
=
{
'赵一'
:
30
,
'丁二'
:
37
,
'孙五'
:
52
,
'王猛'
:
89
,
'周亮'
:
98
}
dict_hero
=
print
(
len
(
list_hero
))
print
(
len
(
dict_hero
))
\ 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