如有数组num=["1","2","3","4","5"]
怎么按照奇、偶数位取数?
写法如下
num=["1","2","3","4","5"] print(num[::2]) print(num[1::2])
执行后
具体参考
https://www.cnblogs.com/tianleblog/p/11590123.html