Python Theory
Comments:
To make the code much more readable.
python interpreter ignores comment.
Two types of comment is possible in python:
1. Single line comment
2. Multi-line comment.
Single line comment
In Python, We use the hash(#)symbol to start writing a comment.
It extends up to the newline character.
Multi-line comments:
There are Two Ways
1. By using # sign at the beginning of each line.
Example |
---|
# It is a # multiline # comment |
2. By using either ' ' ' or " " "(most common)
Example |
---|
"""This is also example of multi-line comments""" |
Identifiers:
A python identifier is a name used to identify a variable, function, class, module or other object.
Rules:
- Sequence of letters and numbers.
- No special character can be used as an identifier except underscore(_).
- Keyword must not be used as identifier.
- Python is case sensitive so using case is significant.
- We cannot use special symbols like !, @, #, $, % etc. in our identifier.