How can I print the first element of the list, if it contains even number of elements. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

How can I print the first element of the list, if it contains even number of elements.

The question is: 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[__])

19th Sep 2018, 10:33 AM
蔡友祥
蔡友祥 - avatar
3 Answers
+ 8
- If it's a question in-between lessons, you can get a hint by tapping on "HINT" button or you can reveal the full answer by tapping "UNLOCK ANSWER" - If it's a quiz (challenge) question, you can see the answer after the challenge ends. Please do either of the above. For explanations of lesson quizzes you can refer to the Comment section, they usually have good explained answers! Thanks.
19th Sep 2018, 11:01 AM
Nikhil
Nikhil - avatar
+ 1
Thank you, Nikhil.
19th Sep 2018, 11:08 AM
蔡友祥
蔡友祥 - avatar
0
20th Dec 2020, 6:32 PM
Hassan Agmir
Hassan Agmir - avatar