Commit c6676d24 by BellCodeEditor

auto save

parent c246157e
Showing with 71 additions and 2 deletions
# # 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
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
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)])
悟空 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
......
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)])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment