for循环
作者:互联网
for循环可以多个值取值:
——3个、4个值时也可以同时取
l = [ ['xiaohei', '123456'], ['xiaobai', '11111'], ['xiaoming', '1'] ] for k,y in l: print(k,y) 结果: xiaohei 123456 xiaobai 11111 xiaoming 1
l = [ ['xiaohei', '123456','110'], ['xiaobai', '11111','112'], ['xiaoming', '1','113'] ] for k,y,s in l: print(k,y,s) 结果:xiaohei 123456 110 xiaobai 11111 112 xiaoming 1 113
标签:xiaoming,11111,xiaobai,循环,110,xiaohei,123456 来源: https://www.cnblogs.com/brf-test/p/12771879.html