A Python identifier is a name used to identify a variable, function, class, module or other object.
Python does not allow punctuation characters such as @, $
, and %
within identifiers.
Python is a case sensitive programming language.
- Class names start with an uppercase letter. All other identifiers start with a lowercase letter.
- Starting an identifier with a single leading underscore indicates that the identifier is private.
- Starting an identifier with two leading underscores indicates a strong private identifier.
- If the identifier also ends with two trailing underscores, the identifier is a language-defined special name.
Python does not use braces({}) to indicate blocks of code for class and function definitions or flow control. Blocks of code are denoted by line indentation.
if True:
print ("True")
else:
print ("False")
Python accepts single ('), double (") and triple (''' or """) quotes to denote string literals. The triple quotes are used to span the string across multiple lines.
print('.')
print("..")
print ("""...
....""")