Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_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
d9822386
authored
Feb 22, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
896e14ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
333.py
ccc.py
333.py
View file @
d9822386
...
@@ -5,7 +5,6 @@ def n_w():
...
@@ -5,7 +5,6 @@ def n_w():
if
unit
==
'q'
or
unit
==
'Q'
:
if
unit
==
'q'
or
unit
==
'Q'
:
break
break
else
:
else
:
try
:
try
:
unit
=
int
(
unit
)
unit
=
int
(
unit
)
except
:
except
:
...
@@ -13,8 +12,8 @@ def n_w():
...
@@ -13,8 +12,8 @@ def n_w():
else
:
else
:
total
.
append
(
unit
)
total
.
append
(
unit
)
return
total
return
total
#
a = n_w()
a
=
n_w
()
#
print(a)
print
(
a
)
...
@@ -30,6 +29,7 @@ def sum(b):
...
@@ -30,6 +29,7 @@ def sum(b):
for
i
in
b
:
for
i
in
b
:
count
=
count
+
i
count
=
count
+
i
return
count
return
count
price
=
n_w
()
price
=
n_w
()
pay
=
sum
(
price
)
pay
=
sum
(
price
)
print
(
"您一共消费了"
+
str
(
pay
)
+
"元!扫码还是现金呢?"
)
print
(
"您一共消费了"
+
str
(
pay
)
+
"元!扫码还是现金呢?"
)
...
...
ccc.py
0 → 100644
View file @
d9822386
def
n_w
():
total
=
[]
while
True
:
unit
=
input
(
"请输入:"
)
if
unit
==
'q'
or
unit
==
'Q'
:
break
else
:
try
:
unit
=
int
(
unit
)
except
:
print
(
"请重新输入一个数字"
)
else
:
total
.
append
(
unit
)
return
total
a
=
n_w
()
print
(
a
)
\ 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