我应该使用“骆驼皮"吗?或在Python下划线? [英] Should I use "camel case" or underscores in python?
本文介绍了我应该使用“骆驼皮"吗?或在Python下划线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
那哪个更好,为什么呢?
So which is better and why?
def my_function():
或
def myFunction():
推荐答案
for everything related to Python's style guide: i'd recommend you read PEP8.
回答您的问题:
函数名称应小写,单词之间用逗号分隔 强调必要以提高可读性.
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
这篇关于我应该使用“骆驼皮"吗?或在Python下划线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文