list = [1, 2, 3, 4] if (list) % 2 == 0 print(list[ ]) | SoloLearn: Learn to code for FREE!

-2

list = [1, 2, 3, 4] if (list) % 2 == 0 print(list[ ])

10/23/2016 6:27:07 PM

pratibha limbole

7 Answers

New Answer

+6

list = [1, 2, 3, 4] if len(list) % 2 == 0: print(list[0])

+3

I was really stuck on that one, you need the lenght of the loop so use len and to print the first element just put the [0]. (y)

+3

what is python

0

list = [1, 2, 3] var list: print( )

0

list = [1, 2, 3] for var list: print( )

0

list=[1,2,3,4] if len(list)%2==0: print(list[0])

-3

what is your question? not an expert in python but maybe you need a "for loop"?