0
HELP
hi everyone, could anyone help me with this exercise? i can't figure out what's missing after if list = [1, 2, 3, 4] if (list) % 2 == 0: print(list[0])
6 Answers
+ 3
We cant perform % or modulus between list and integer.
maybe the length would return an integer, hmm... elliot what do you think? đ€đ€
+ 3
Read again the question, and find what the question is asking for.
+ 2
found! I had to put "len" after "if", thank you all!
+ 1
yes the problem is that it is a SoloLearn exercise of the Python course, "Control Structures" exercise "Module 3 Quiz" ... there is a blank space after the "if" to fill in but I have no idea what to put in it
+ 1
What function or built-in method that takes a list as argument and return an integer value?
0
You can iterate throw the list using for loop and then make the if condition in each iteration to check if the element is even
for num in list:
if num%2 == 0: ....