Fill in the blanks to 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
- 1

Fill in the blanks to print the first element of the list, if it contains even number of elements.

Hi, does anyone know how to answer this question: list = [1, 2, 3, 4] if (list) % 2 == 0 : print(list[ ])

22nd Aug 2017, 7:45 PM
Nathaniel Manning (SSBG-CORNER)
Nathaniel Manning (SSBG-CORNER) - avatar
4 Answers
+ 3
list = [1, 2, 3, 4] if len(list) % 2 == 0: print(list[0])
22nd Aug 2017, 11:52 PM
ChaoticDawg
ChaoticDawg - avatar
+ 3
list = [1, 2, 3, 4] if len(list) % 2 == 0: print(list[0])
4th May 2018, 10:46 AM
Mahnoor Shahzad
Mahnoor Shahzad - avatar
0
Thanks much... for some reason I just couldn't figure that one out!
23rd Aug 2017, 2:30 PM
Nathaniel Manning (SSBG-CORNER)
Nathaniel Manning (SSBG-CORNER) - avatar
0
Fill in the blanks to add two background images to the element, with the first positioned at the top left corner, and the other at the top right corner. Help me Pls
6th Jan 2021, 7:32 PM
ะะปะตะบัะฐะฝะดั€ ะกะตั€ะณะตะตะฒ
ะะปะตะบัะฐะฝะดั€ ะกะตั€ะณะตะตะฒ - avatar