Commit 2ff814ae by BellCodeEditor

save project

parent 05fc9083
Showing with 9 additions and 4 deletions
with open(r"c:\Users\欧阳嘉锐\Documents\lesson13-3\sales_list.txt","r",encoding="utf-8") as file:
ith open(r"c:\Users\欧阳嘉锐\Documents\lesson13-3\sales_list.txt","r",encoding="utf-8") as file:
str=file.readlines()
for data in str:
new_data=data.split()
print(new_data[0])
print(new_data[1:])
\ No newline at end of file
sum=0
for i in new_data[1:]
sum += int(i)
new_str=str(new_data[0])
print(type(new_str[0]))
#print(new_data[0])
#print(new_data[1:])
\ No newline at end of file
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