Computer Science, asked by atchayaveeramani665, 7 months ago

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 saigoms
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