8

dubSmall = lambda x: x*(2-min(1,x//100))

dubSmall = lambda x: 2*x if x < 100 else x

I prefer the first one, and I think people will always hate me for that.

Comments
  • 0
    Marvelous.
  • 0
    I prefer the second one because I try to write code that's more easily understandable for other developers since the latter flows more like a natural English
  • 0
    @le-idiot you just put words into my mouth. That's exactly what I wanted to say. I want to go further and say being "clever" is never a good practice. That's my two cents.
  • 0
    dubSmall = lambda x: x+(x < 100)*x
  • 0
    @le-idiot @dance2die I understand that but I have an unhealthy obsession with cutting out if statements. My last comment is probably what I would actually write.
  • 0
    Also @le-idiot I def thought your username began with a capital i as in "Internet Explorer Idiot"
Add Comment