通过枚举实现 for i,value in enumerate(['A', 'B', 'C']) print(i,value) 转载:https://blog.csdn.net/dtiove/article/details/78915029