IndentationError: expected an indented block

>>> while n<99:
... L.append(n)
  File "<stdin>", line 2
    L.append(n)
    ^
IndentationError: expected an indented block


是缺少空格 python对于格式都很严格


正确:

>>> while n<99:
...   L.append(n)
...   n=n+3



猜你喜欢

转载自blog.csdn.net/hanlinger_/article/details/79403763