News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by bkz on Thursday June 03, 2010 @02:31PM (#1402065)
Funny how readable Python is:

def condense(s, remove): return "".join([c for c in s if c != remove])

Cheating (2.6+): s.translate(None, remove)

Re:Interviewing programmers: coding test example explained by JoachimSchipper on Thursday June 03, 2010 @06:07PM (#1402767)
You are aware that this is, to a C programmer, horribly inefficient? (Specifically, it violates the "in-place" requirement, but the actual overhead of that is dwarfed by everything else.)
Re:Interviewing programmers: coding test example explained by zepolen on Friday June 04, 2010 @08:46AM (#1404123)
Either you do it correctly (as in list manipulation, in place) or do it pythonically. That code is somewhere in between.

The pythonic version would be s.replace(c, '')