+ 1
What is the is the difference between Lastname and lastname
3 Answers
+ 4
Both are valid name and treated as defferent variables because Python is case sensitive.
By convention, variable names in Python are usually lowercase like "lastname" or lowercase with under score like "last_name".
+ 2
Usually, use of Uppercase at first letter of a variable identifier is meaning that it define a class... So, you often will see codes like that:
class Box:
def __init__(self):
self.type = "box"
box = Box()
There is no ambiguity ( for computer, a little more for a human eye :P ) between 'box' and 'Box', and you can see to the first look what are classes, and what are not, among your differents variable in the code ;)
0
Mmh it's like an ethic ^^ it's better to start ure variable name by lowercase ! ;)