Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-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
980a7671
authored
Jun 26, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
7c22ae62
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7905 additions
and
16 deletions
4399.py
H.py
L.py
diy.py
new_sales_list.txt
4399.py
0 → 100644
View file @
980a7671
count
=
0
n
=
int
(
input
(
"请输入金额:"
))
for
i
in
range
(
0
,
n
//
10
+
1
):
#10元
for
j
in
range
(
0
,
n
//
20
+
1
):
#20元
for
k
in
range
(
0
,
n
//
50
+
1
):
#20元
if
i
*
20
+
k
*
20
+
k
*
50
==
n
:
#50元
print
(
i
,
j
,
k
)
count
+=
1
print
(
count
)
H.py
0 → 100644
View file @
980a7671
for
i
in
range
(
1
,
10
):
for
j
in
range
(
1
,
i
+
1
):
print
(
i
,
"*"
,
j
,
"="
,
i
*
j
,
end
=
" "
)
print
()
\ No newline at end of file
L.py
0 → 100644
View file @
980a7671
n
=
100
t
=
0
c
=
int
(
input
"输入一个正数:"
)
n
*=
c
diy.py
View file @
980a7671
with
open
(
r"c:\Users\EDZ\Documents\lesson13-1\sales_list.txt"
,
"r"
,
encoding
=
"utf-8"
)
as
file
:
score
=
{
'语文'
:
93.5
,
'数学'
:
100
,
'英语'
:
98
}
a
=
file
.
readlines
()
for
k
,
v
in
score
():
print
(
score
[
i
])
fin
=
[]
for
i
in
a
:
for
k
in
good
.
keys
():
sum
=
0
print
(
score
[
i
])
data
=
i
.
split
()
for
in
good
.
values
():
# print(data[0])
print
(
i
)
# print(data[1:])
for
sales
in
data
[
1
:]:
sum
=
sum
+
int
(
sales
)
result
=
data
[
0
]
+
":"
+
str
(
sum
)
+
"
\n
"
fin
.
append
(
result
)
with
open
(
r"c:\Users\EDZ\Documents\lesson13-1\new_sales_list.txt"
,
"a"
,
encoding
=
"utf-8"
)
as
file
:
a
=
file
.
writelines
(
fin
)
\ No newline at end of file
new_sales_list.txt
View file @
980a7671
...
@@ -11,3 +11,16 @@
...
@@ -11,3 +11,16 @@
刘阳:226
刘阳:226
王胜男:123
王胜男:123
王娇:131
王娇:131
悟空:348
诺依:380
小贝:182
李丽:201
宋扬:107
王明:245
李强:164
孙小白:222
苏琪:137
刘若若:147
刘阳:226
王胜男:123
王娇:131
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