Commit 5148a9bb by BellCodeEditor

auto save

parent a073d71d
Showing with 6 additions and 2 deletions
......@@ -9,5 +9,8 @@ file=open(r'C:\Users\HP\Desktop\bell\文件读写\book.txt','r',encoding='utf-8'
with open(r'C:\Users\HP\Desktop\bell\文件读写\book.txt','r',encoding='utf-8') as file:
a=file.readlines()
for i in a:#用for...in...将每一行的数据遍历一边
print(i)
data=i.split()#把字符串切片成一个个的字符串
print(data[0])#是打印出名字
print(data[1:])#打印出所有的数字
print(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