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
c6676d24
authored
Aug 27, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c246157e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
2 deletions
1.py
2.py
diy.py
sales_list.txt
sz.py
1.py
0 → 100644
View file @
c6676d24
# # a=int(input("输入三位数:"))
# # print("百:"+str(a//100),"十:"+str(a%100//10),"个:"+str(a%10),sep=",")
# import turtle
# turtle.goto(-100,0)
# turtle.color("black","green")
# turtle.begin_fill()
# # turtle.right(60)
# turtle.circle(100,steps=3)
# turtle.end_fill()
# turtle.left(90)
# turtle.setposition(0,0)
# turtle.done()
# print(int(3.64))
# y=2
# x=(y==1)
# print(x)
# a='a'
# b='b'
# print(a+b*2)
# print(479%10%10)
# import turtle
# turtle.backward(200)
# turtle.forward(-200)
# turtle.done()
print
(
-
6
*-
3
);
print
(
"你好!"
);
print
(
"sk"
);
if
\ No newline at end of file
2.py
0 → 100644
View file @
c6676d24
import
turtle
import
random
turtle
.
penup
()
turtle
.
goto
(
0
,
-
100
)
turtle
.
pendown
()
turtle
.
colormode
(
255
)
turtle
.
color
((
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
)),(
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
)))
turtle
.
begin_fill
()
turtle
.
circle
(
-
200
)
turtle
.
end_fill
()
turtle
.
fillcolor
(
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
),
random
.
randint
(
0
,
255
))
turtle
.
begin_fill
()
turtle
.
circle
(
200
,
steps
=
5
)
turtle
.
end_fill
()
turtle
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
diy.py
View file @
c6676d24
with
open
(
r'c:\Users\Administrator\Documents\lesson13-1\sales_list.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
kk
:
a
=
kk
.
readlines
()
print
(
a
)
data
=
[]
all
=
0
for
i
in
a
:
k
=
i
.
split
()
print
(
k
)
sum
=
0
# for i in range(1,len(k)):
# p=int(k[i])
# sum=sum+p
for
pp
in
k
[
1
:]:
sum
=
sum
+
int
(
pp
)
all
=
all
+
sum
print
(
all
)
total
=
k
[
0
]
+
str
(
sum
)
+
'
\n
'
data
.
append
(
total
)
with
open
(
r'C:\Users\Administrator\Desktop\pp.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
dd
:
dd
.
writelines
(
data
)
dd
.
writelines
([
"总共:="
,
str
(
all
)])
sales_list.txt
View file @
c6676d24
悟空 12 15 11 12 11 12 13 21 27 12 15 30 22 26 15 12 21 23 27 11
悟空 12 15 11 12 11 12 13 21 27 12 15 30 22 26 15 12 21 23 27 11
诺依 21 29 15 21 21 21 29 30 12 13 12 12 24 52 27 26 15
小贝 29 11 11 15 13 15 13 11 11 29 13 11
李丽 13 15 20 15 15 11 17 20 20 11 12 12 20
...
...
sz.py
0 → 100644
View file @
c6676d24
with
open
(
r'C:\Users\Administrator\Desktop\11.txt'
,
'r'
,
encoding
=
'utf-8'
)
as
kk
:
a
=
kk
.
readlines
()
print
(
a
)
data
=
[]
all
=
0
for
i
in
a
:
k
=
i
.
split
(
"-"
)
print
(
k
)
sum
=
0
# for i in range(1,len(k)):
# p=int(k[i])
# sum=sum+p
for
pp
in
k
[
1
:]:
sum
=
sum
+
int
(
pp
)
all
=
all
+
sum
print
(
all
)
total
=
k
[
0
]
+
str
(
sum
)
+
'
\n
'
data
.
append
(
total
)
with
open
(
r'C:\Users\Administrator\Desktop\pp.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
dd
:
dd
.
writelines
(
data
)
dd
.
writelines
([
"总共:="
,
str
(
all
)])
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