Hi, please I need someone to help me complete the missing line in the if statement thanks. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi, please I need someone to help me complete the missing line in the if statement thanks.

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

28th Aug 2019, 1:34 PM
Peter Ugochukwu
Peter Ugochukwu - avatar
5 Answers
+ 7
an other guess: List = [1,2,3,4] if len(List)%2 ==0: print(List[0]) # output: 1
28th Aug 2019, 2:17 PM
Lothar
Lothar - avatar
+ 4
hi, see my comment : ''' List = [1,2,3,4] if __(list)%2 ==0: print(list[0]) ''' # is it like this? lst = [1,2,3,4] for i in lst: if i %2 == 0: print(i) # output: ''' 2 4 '''
28th Aug 2019, 1:40 PM
Lothar
Lothar - avatar
+ 1
Comment to each quiz is at lower left, not upper right. https://www.sololearn.com/post/131750/?ref=app
28th Aug 2019, 2:56 PM
Gordon
Gordon - avatar
+ 1
Thanks guys... Later figured it out...
28th Aug 2019, 4:14 PM
Peter Ugochukwu
Peter Ugochukwu - avatar
0
No... It's a module Quiz question... I have to complete the: if _(list)%2==0: I tried using 'not' e.g: if not(list)%2==0: but that's not it
28th Aug 2019, 1:49 PM
Peter Ugochukwu
Peter Ugochukwu - avatar