- 10
list = [1, 2, 3, 4] if (list) % 2 == 0 print(list[ ])
10 Respuestas
+ 8
list = [1, 2, 3, 4]
if len(list) % 2 == 0:
print(list[0])
+ 6
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)
+ 4
what is python
+ 3
why should we take len function to get even numbers
0
list = [1, 2, 3]
for
var
list:
print(
)
0
list=[1,2,3,4]
if len(list)%2==0:
print(list[0])
0
It is a quiz question on the section control structure. The question was a bit tricky to understand. To get the number of elements in the list. we need to use len() function.
0
i cant understand the print (list[0])
- 1
list = [1, 2, 3]
var
list:
print(
)
- 2
what is your question?
not an expert in python but maybe you need a "for loop"?