Are there any pitfalls with using whitespace in Python?

后端 未结 17 1184
时光取名叫无心
时光取名叫无心 2021-01-06 17:36

At the moment I have never had a problem with whitespace in Python (although I\'ve only used it in two projects and I was the only programmer). What are some potential pitf

17条回答
  •  伪装坚强ぢ
    2021-01-06 18:03

    It can be confusing in some editors where one line is indented with spaces and the next is indented with a tab. This is confusing as the indentation looks the same but causes an error.

    Also when your copying code, if your editor doesn't have a function to indent entire blocks, it could be annoying fixing all the indentation.

    But with a good editor and a bit of practice, this shouldn't be a problem. I personally really like the way Python uses white space.

提交回复
热议问题