Add example for variable names with multiple words
r-mueller opened this issue · 4 comments
Regarding https://www.pythonsheets.com/notes/python-basic.html#python-naming-styles.
An example for variable names with compound words would be nice.
For example. Should a method local variable be called userName
or user_name
?
Based on PEP8 - Method Names and Instance Variables
Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability.
It imply that using user_name
not userName
.
I think python like under_scope style rather than CamelCase.
CamelCase seems only used by ClassName
and TypeVariable
and no mixedCase
.
Oh!! Do you mean add some examples like below?
# good
user_name = 'Guido'
# bad
userName = 'Guido'
Yes this was the idea. I did not know PEP8. And from https://www.pythonsheets.com/notes/python-basic.html#python-naming-styles. it was not clear on how to seperate names in variables. But now i know it is user_name
😃
OK! I will add it later! 👍