python-enumerate() 函数的用法
seasons = ['Spring', 'Summer', 'Fall', 'Winter'] print(list(enumerate(seasons))) for i,value in enumerate(seasons): print(i,value) 输出结果: [(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')] 0 Spring 1 Summer 2 Fall 3 Winter
踩坑是成长最快的方式