那么哪个更好,为什么?
def my_function():
或
def myFunction():
最佳答案
有关 Python 样式指南的所有内容:我建议您阅读 PEP8 .
回答你的问题:
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
关于python - 我应该在 Python 中使用 "camel case"还是下划线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8908760/