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[
])
Answers
Answered by
1
Answer:
list = [1, 2, 3, 4]
if len(list) % 2 == 0:
print(list[0])
Explanation:
To print the first element use indexing list[0]
It should check the entire list. so use len function
Use the syntax for :
Similar questions