Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What do you mean crazy weird if statements? You can do one liners, or if you don't your indentation is similar to what you'd see in C++.

if condition: return expression if condition: foo = value

or

if condition: body statements elif condition: body statements else: body statements



Indent by

  two spaces
to get your line breaks to show up.


Yes, I do this, and this would be great if Python officially recommended spaces, but they recommend tabs, poisoning the well further.


?

• I was talking about Hacker News markup.

• Python officially recommends spaces: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces


The colon has always struck me as crazy weird, like we're righting C gotos or something




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: