• ###### andy_lzcommented on "Sorting by bits" python solution

why I don't know '.count()'

• ###### froggie901commented on "Even numbers in an array" python solution

How would you overcome that?

thanks

• ###### FArekkusucommented on "Get Nth Even Number" python solution

Semicolon can be used a separator but it's limited compared to other C-like languages.

• ###### emceelarencommented on "Get Nth Even Number" python solution

I'm reading something about a semicolon being a seperator.

• ###### emceelarencommented on "Get Nth Even Number" python solution

ok, I understand. But I see it in a few solutions, is there any stylistic reason someone would do that? Or is that a behavior that happens in other languages and is unneccesary in python but could be done if someone was inclined?

• ###### Unnamedcommented on "Get Nth Even Number" python solution

No reason at all. Someone submitted it first and all solutions without it got grouped with that solution.

• ###### emceelarencommented on "Get Nth Even Number" python solution

why the semi colon? I'm a beginner

• ###### Blind4Basicscommented on "Count the smiley faces!" python solution
1. yes, same as '?'
2. for the group that is just before only
• ###### yellowBunnycommented on "Count the smiley faces!" python solution

This comment is hidden because it contains spoiler information about the solution

• ###### anter69commented on "Row Weights" python solution

You have a good point there, indeed.

I would measure it against a simple `if index is even .. else` loop, but that's probably not any faster. Thanks for the heads up!

• ###### fenring76commented on "Row Weights" python solution

IIRC, a slice has a time complexity of O(k) (with k == the number of items). So, going over two halves of the array are roughly equivalent to going over the array once. I imagine there is a bit of overhead for the stepping, but I doubt it's much. I'm really not sure how you'd optimize this code in pure python.

• ###### anter69commented on "Row Weights" python solution

Not really best practice, because you traverse the array twice, but at least it's clear :-)

• ###### Jomo Pipicommented on "Single character palindromes" python solution

lol, my solution verbatim

• ###### anter69commented on "Even numbers in an array" python solution

Not really best practice, because you traverse the whole list, although in most cases it's not needed.