+ 1
Python challenge
Hi there. I was recently participating in Sololearn Python Challenge game and faced a strange question: Made a screenshot of it. It seems erroneous. Showed to my experienced colleague and he says the same. Could you suggest, what you think it is? âFill in the blanks (marked them as ...) to print all even numbers in the list.â Lst= [] For i in range(12): If i[b] ... ... [/b]2 == 0: Lst.append(...) continue print (Lst)
9 Answers
+ 7
if i%2 == 0:
lst.append(i)
+ 5
I think I know what is happening.
The [b] ... [/b] is like an opening and closing tag like in html and are supposed to be invissible.
Gordons solution is 100% correct.
The problem with it being visible is it looks like a list being adressed.i[b]
And i is an integer, not a list
And b is not defined
+ 3
viktoras ciumanovas do you have an apple?
+ 3
viktoras ciumanovas Sorry, feed post is not yet available on IOS.
+ 1
Hi Louis,
yes I have screenshot, just not sure how to post it in the feed (was not allowed to paste screenshot as part of the question either). Would you mind giving me a hint how to add screenshot to the feed?
+ 1
yes
+ 1
Ok, no issue. I can send it via e-mail or add it somewhere (i.e., cloud) - still think it would be good to address
+ 1
Louis,
here it is: https://spaces.hightail.com/space/X7G1UUPaKz
+ 1
I see now, that makes sense. Thus the initial thought was right- itâs an issue with the task/challenge.
âThe case is closedâ :)
Thanks guys for your support!