+ 5
Is the following code correct?
x=[] for y in range(12): if y[b] % [/b]2 == 0: x.append(y) continue print(x) https://sololearn.com/compiler-playground/csV77YpQt9uW/?ref=app
16 Answers
+ 5
do not put links in the tag section. we cannot click on your code. tag the relevant programming language
there is no [b] [/b] tag in Python.
+ 5
+ 4
You sure you write down the code the right way? Because this is definitely gonna encounter with syntax error and name error.
+ 4
i think reporting the question/ code as wrong – which you already did – is the only thing we can do...
i don't think sololearn currently tries to fix anything about the challenges at the moment, so no idea if/when it might get fixed
+ 4
you can leave your thread here as long as you like and delete it whenever you like. it's totally up to you!
+ 3
I found this question somewhere on Sololearn. I have reported it many times, but it is still not corrected.
+ 3
As Lisa pointed out Abdurahman Jemal Adem the code should be
x=[]
for y in range(12):
if y%2 == 0:
x.append(y)
continue
print(x)
I'm confused as to where you obtained
[b] [/b] BB coding format
+ 2
BroFar
if that's the formatting of the challenge, it might be the same as in the old course/ when users could submit own lessons?
+ 1
from the error message you can see that the code is not correct.
there is no [b] [/b] tag in python.
wherever the code is taken from, it had some text formatting and the formatting tags were also copied. just remove them.
+ 1
BroFar you're right, and I understand that. I found this code as a correct answer to a code challenge question.
But the code itself is not correct.
+ 1
remove it from where?
i thought it was part of a challenge quiz?
+ 1
Abdurahman Jemal Adem ,
I remember playground examples in various lessons in various courses where the given code is intentionally incorrect, and your job is to correct it.
Might this be one of those examples?
I would correct it thus.
x = []
for y in range(12):
if y%2 == 0:
x.append(y)
continue
print(x) # [0, 2, 4, 6, 8, 10]
0
Lisa sorry for that, but now I have changed it.
0
So now what do you recommend me Lisa
Should I remove it?
0
Lisa
From my question