l = "egon:123:admin" i = l.split(":")#i=l.split(":",1)以l列表内的:为分隔符,把左右两边用,号分隔开
显示结果为
['egon', '123', 'admin']
l = "egon:123:admin" i = l.split(":",1) print(i)
显示结果为
['egon', '123:admin']
2024-03-13 22:43:40
l = "egon:123:admin" i = l.split(":")#i=l.split(":",1)以l列表内的:为分隔符,把左右两边用,号分隔开
显示结果为
['egon', '123', 'admin']
l = "egon:123:admin" i = l.split(":",1) print(i)
显示结果为
['egon', '123:admin']
下一篇:day 4 list,元祖