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
6721ccb0
authored
Dec 19, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
db0d9878
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
31 deletions
.vscode/settings.json
1.py
func.py
.vscode/settings.json
View file @
6721ccb0
...
...
@@ -6,7 +6,7 @@
"-p"
,
"*test.py"
],
"python.testing.pytestEnabled"
:
fals
e
,
"python.testing.pytestEnabled"
:
tru
e
,
"python.testing.nosetestsEnabled"
:
false
,
"python.testing.unittestEnabled"
:
false
,
"python.testing.promptToConfigure"
:
false
...
...
1.py
View file @
6721ccb0
def
new_input
():
total
=
[]
while
True
:
unit
=
input
(
"请输入,按p退出:"
)
if
unit
==
'q'
:
break
else
:
try
:
unit
=
int
(
unit
)
except
:
print
(
'要输入整数'
)
else
:
total
.
append
(
unit
)
return
total
price
=
new_input
print
(
'='
*
30
)
print
(
price
)
s
=
0
# for i in price:
# s+=i
# print(str(s))
print
()
# print(total)
\ No newline at end of file
# def new_input():
zx
=
[
'爆肚'
,
44
]
xx
=
[
'米饭'
,
2
]
vx
=
[
'鱼香肉丝'
,
32
]
total
=
[
str
(
zx
)
+
zx
,
str
(
xx
)
+
xx
,
str
(
vx
)
+
vx
]
print
(
total
)
# while True:
# print("菜单:"+total)
# unit=input("请输入,按q退出")
# if unit== 'q':
# break
# else:
# try:
# unit=int(unit)
# except:
# print('要输入整数')
# else:
# total.append(unit)
# print(total)
# return total
# price=new_input()
# print('=*30')
# print(price)
# s=0
# for i in price:
# s+=i
# print("价格是:"+str(s))
func.py
View file @
6721ccb0
def
new_input
():
total
=
[]
while
True
:
unit
=
in
t
(
input
(
"请输入,按p退出"
)
)
unit
=
in
put
(
"请输入,按q退出"
)
if
unit
==
'q'
:
break
else
:
...
...
@@ -19,4 +19,4 @@ print(price)
s
=
0
for
i
in
price
:
s
+=
i
print
(
str
(
s
))
print
(
"价格是:"
+
str
(
s
))
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