4 ms·
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 e
by burnished 5y ago
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
- wizzwizz4 5y agoIndent by two spaces to get your line breaks to show up.
- sam0x17 5y agoYes, I do this, and this would be great if Python officially recommended spaces, but they recommend tabs, poisoning the well further.
- wizzwizz4 5y ago? • I was talking about Hacker News markup. • Python officially recommends spaces: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
- sam0x17 5y agoThe colon has always struck me as crazy weird, like we're righting C gotos or something