Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
acjohnson55
12y ago
0 comments
Save
Share
But if indentation matters, and it's pressent, then why do you need the colon?
0 comments
1 comments · 1 top-level
top
newest
oldest
ptx
12y ago
Well, the colon can be used without indentation if the block that follows is just a single line:
def embiggen(x): return x * 2 for i in range(10): print(embiggen(x))
Also, it just makes things read more naturally to us humans, I think.
j
/
k
navigate · click thread line to collapse