+ 4
I need help with this python code:
Fill in the blanks to print the first element of the list, if it contains even number of elements. list = [1, 2, 3, 4] if___(list) % 2 == 0 print(list[0])
1 Answer
+ 6
you should use the len function, it returns the length of the array
list = [1, 2, 3, 4]
if len(list) % 2 == 0:
print(list[0])