0
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 len(list )%2 ==0: print (list [ 0 ]) why it is len after if
9 Respostas
+ 7
"len" gives you the number of elements in the list. As you want to find out if the number of elements is even or odd you have to use the "len" operator.
+ 5
len, :, 0
+ 5
list =[1 ,2 ,3 ,4 ]
if len(list )%2 ==0:
print (list [ 0 ])
bcz len meaning check length of this list so after if check that list
+ 2
A computer runs codes One Line after the other. First , a new list of even numbers is generated[0,2,4,]
Secondly, the first element[0] is then printed out.
0
len
:
0
0
list = [10,11,12,13]
if len(list)%2 ==0:
print(list[0])
0
list =[1,2,3,4]
if len(list) % 2 == 0:
print(list[0])
- 8
completed it mate
- 10
first, you play roblox and then you ask yourself I need a girlfriend orrrr you think about your weird ddream that happened today and you feel something like............... I have no more characters remaining ....
boomer
also goodbye P.S I'm stupid