Commit 5908f29f by BellCodeEditor

save project

parent 32ba349a
Showing with 15 additions and 4 deletions
enco
\ No newline at end of file
txt = 'wecome to the bellcode'
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
a = file1.readlines()
# print(a)
for i in a:
print(i)
for i in a: for...in...把每一行的数据遍历
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