Python indentation in “empty lines”

前端 未结 10 2076
野性不改
野性不改 2020-12-29 18:29

Which is preferred (\".\" indicating whitespace)?

A)

def foo():
    x = 1
    y = 2
....
    if True:
        bar()

B)



        
10条回答
  •  -上瘾入骨i
    2020-12-29 19:10

    If you use A, you could copy paste your block in python shell, B will get unexpected indentation error.

提交回复
热议问题