names = "张三,李四,王二" name_li = names.split(",") for i in name_li: print(i)
当我们运行这块代码的时候,报错
Non-UTF-8 code starting with 'xe6' in file
原因是因为开头缺失了:#coding=utf-8 所以,别忘了开头的#coding=utf-8哟