+ 1

What is the is the difference between Lastname and lastname

20th Feb 2017, 4:42 PM
Joshua Gaspar
Joshua Gaspar - avatar
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".
20th Feb 2017, 5:04 PM
Twelfty
Twelfty - avatar
+ 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 ;)
21st Feb 2017, 5:00 AM
visph
visph - avatar
0
Mmh it's like an ethic ^^ it's better to start ure variable name by lowercase ! ;)
20th Feb 2017, 4:44 PM
Oliveur “Fyrea” MRN
Oliveur “Fyrea” MRN - avatar