News for hackers. Stuff that matters.
Re:Unpythonic Python by drivers99 on Wednesday April 09, 2014 @03:52PM (#7561890)
He forgot one on the "i += 1" (which would be i++ in a for loop but Python doesn't have that operator).

But that whole line is weird, because I think the C example should use a "for" loop, not increment the main counter at the top of a while loop, even if it has to use "for i in range(1, 101)" like in pythonic python. A C programmer like me (who loves python too) would immediately think "for (i = 1; i <= 100; i++)" for that (although counting from 1 is strange, it's what the problem asks for).

Re:Unpythonic Python by eriktaubeneck on Wednesday April 09, 2014 @05:31PM (#7562593)
This is what I originally had but I felt that the Python `while` was actually a bit more true to the way a C for loop is constructed (and `range` seems a very not C thing to do.) It's not perfect!