How to know if a list has an even or odd number of elements

后端 未结 8 1945
离开以前
离开以前 2021-01-28 01:20

How can I find out if there is even, or odd, number of elements in an arbitrary list.

I tried list.index() to get all of the indices... but I still don\'t k

8条回答
提交回复
热议问题