Any tips on how I should properly be naming python variables? Like any correct forms or for clean code.
Like for instance
myNum = 1
or
mynum = 1
or
my_num = 1
Any tips on how I should properly be naming python variables? Like any correct forms or for clean code.
Like for instance
myNum = 1
or
mynum = 1
or
my_num = 1
PEP 8 recommends my_num
. @Merp's comment is correct though. Be clear and consistent with whatever convention you choose.
Well, traditionally developers follow the 'camelCase' variable naming proceedure in most languages, which is basically shown in your 1st code snippet. However, there are exceptions in the wide range of programming languages out there in terms of norms that manifest themselves over time. In Python, most developers tend to use the variable naming shown in your 3rd code snippet, separating each word with an underscore.