Commit 5908f29f by BellCodeEditor

save project

parent 32ba349a
Showing with 15 additions and 4 deletions
enco txt = 'wecome to the bellcode'
\ No newline at end of file new_txt = txt.split()
print(new_txt)
txt1 = "阿萨德,颚骨,七点,"
new_txt1 = txt1.split(',')
print(new_txt1)
...@@ -2,5 +2,8 @@ with open (r'c:\Users\ThinkPad\Documents\lesson13-1\sales_list.txt','r',encoding ...@@ -2,5 +2,8 @@ with open (r'c:\Users\ThinkPad\Documents\lesson13-1\sales_list.txt','r',encoding
a = file1.readlines() a = file1.readlines()
# print(a) # print(a)
for i in a: for i in a: for...in...把每一行的数据遍历
print(i) data = i.split() 把字符串切片切分成更细的一个个子富川
print(data[1:])
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