python - Python 中推荐的缩进大小是多少?

标签 python indentation

是否有关于 Python 代码应如何缩进的任何官方规则/建议?

最佳答案

来自 PEP 8 (Python 的官方风格指南):

Use 4 spaces per indentation level.

关于python - Python 中推荐的缩进大小是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15623229/

相关文章:

python - asyncio.gather(*tasks) 仅等待所有任务的子集失败

python - 在 Numpy 中定义计算 IQR 的函数

python - 将 timedelta 转换为 int

html - float 元素旁边的自编号列表的文本缩进错误

python - 在Django下执行长时间运行的任务/批处理的可靠方法是什么?

python - 如何在 Pandas 中选择缺失数据超过一定数量的行/列?

SQL语句缩进的好习惯

c++ - 自定义 google-c-style.el

ruby - 如何在 Vim 中覆盖 Ruby 的默认 tabindent?

intellij-idea - 在IntelliJ IDEA中更改选项卡->空间->选项卡的快捷方式