Python Notes
Python Notes
2.
Identifiers(How to name)
1. Cannot have a keyword
2. Cannot start with a digit
3. All digits and all letters can be used
4. No special symbols except the _ can be used.
5. Can be unlimited length
Literals
Different types
1. String Literals
2. Numeric Literals
3. None(Special)
4. Collection(Lists, tuples)
5. Boolean
1. String
String literals are literals which are strings, ie.
Enclosed with or
There is a special function len() to determine the
length of the literal
For single line literals, len includes all the spaces
along with all the characters
For multi line strings, len() counts even the
character (blank space at the end of the word) This
can be avoided if one puts \ a backslash at the
end of the word/line
f) Assignment Operators
Combines 2 operatores
a. a += n is the same as a
= a+n
b. a -= n is the same as a =
an
g)Logical Operators
a. and
b. or
h) Membership Operators
a. in
b. not in
4. Punctuators
Used to organize programming structures