Why doesn't this work?(Purify)


#1

Code for Purify problem

def purify(x):
heck=[]
for even in x:
if even%2==0:
heck.append(even)
return heck


#2

That raises a few questions like what you mean by work and what you mean is happening differently from that, along with what the code really looks like because it probably doesn’t look like that:


#3

By work I mean be an accepted answer for the problem. I ended up just getting the code for it and it looked very similar. And yes it did look a little different as I had it indented but for some reason it didn’t post properly.


#4

Forums (most, not just this one) apply formatting to posts, and have a button in the editor for disabling that (for posting code or other content sensitive to modifications)
Since code needs to be shared as byte-for-byte copies lest it may mean something else (or be gibberish), that is very much such content

I’m no fan of the “get code” feature’s existence, or of how it’s done. I do suggest casting a very careful eye when you compare in order to find the difference, perhaps even improve on that solution (I’ve seen some really bad ones). Of course, I can’t tell you what you “should” do because “should” is something you decide what it is.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.