Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-4
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
3f0467a8
authored
Dec 16, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ef431809
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
21 deletions
diy1.py
quiz.py
diy1.py
View file @
3f0467a8
...
@@ -34,14 +34,4 @@ def sum(money):
...
@@ -34,14 +34,4 @@ def sum(money):
# 设置变量count
# 设置变量count
count
=
0
count
=
0
# 遍历列表
# 遍历列表
for
i
in
money
:
# 计算总价
count
=
count
+
i
# 返回总数count
return
count
\ No newline at end of file
price
=
new_input
()
# 调用函数sum并赋值给pay
print
(
"您一共消费了"
+
str
(
pay
)
+
"元!扫码还是现金呢?"
)
\ No newline at end of file
quiz.py
View file @
3f0467a8
# 勇于挑战的创造师,下面的代码犯了两类典型错误,请你把bug揪出来吧。
import
s
area
=
[
'盘丝洞'
,
'白骨洞'
,
'大雁塔'
]
b
=
s
.
new_inpot
()
monster
=
{
'盘丝洞'
:
'蜘蛛精'
,
'白骨洞'
:
'白骨精'
,
'大雁塔'
:
'花妖'
}
a
=
s
.
sums
(
b
)
# 打印出大雁塔
print
(
a
)
print
(
area
[
3
])
\ No newline at end of file
# 向字典中添加 '地府':'僵尸'
monster
.
append
(
'地府'
,
'僵尸'
)
print
(
monster
)
\ 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