|
|
|
|
|
by daveguy
3716 days ago
|
|
Also in python 2.7 (and I assume py3k stuff too) conditionals also have lazy evaluation if you have the statement: if False and (fibonacci(1000)/fibonacci(1000)): print "Nope"
It will immediately evaluate to False and pring "Nope" rather than checking the (fibonacci(1000)/fibonacci(1000)) portion of the conditional.EDIT: Side note, is there a shortcut for displaying code snippets within HN posts? Extra returns (what I usually use for clarification by formatting) do not display very well. |
|
Indent your code snippets with a minimum of four spaces and they will be rendered as preformatted, monospaced text. Vertically adjacent lines thus indented will be rendered as a single block.