Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson11_5
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
9ff7c81e
authored
May 25, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0595e6aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
38 deletions
func.py
ngnghjbnduxhb.py
func.py
View file @
9ff7c81e
def
new_input
():
mbjg
=
[]
while
True
:
lkoj
=
input
(
"请输入"
)
if
lkoj
==
"q"
:
break
else
:
try
:
lkoj
=
int
(
lkoj
)
except
:
print
(
"请输入一个整数"
)
else
:
mbjg
.
append
(
lkoj
)
print
(
"_"
*
30
)
return
mbjg
def
sum
(
money
):
kkk
=
0
for
i
in
money
:
kkk
=
kkk
+
i
return
kkk
# cfsd = new_input()
# pay = sum(cfsd)
#print("你一共消费" + str(pay)+"元扫码还是现金呢?")
ngnghjbnduxhb.py
View file @
9ff7c81e
import
func
file1
=
open
(
r'd:\test.txt'
,
'w'
,
encoding
=
'utf-8'
)
file1
.
write
(
"小兰:12本"
)
cfsd
=
func
.
new_input
()
file1
.
close
()
pay
=
func
.
sum
(
cfsd
)
\ No newline at end of file
print
(
"这位选手你的分数是"
+
str
(
pay
)
+
"分"
)
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