Professional Documents
Culture Documents
2id Keywords Buitinfuntion
2id Keywords Buitinfuntion
We have to use names to identify variable or to identify methode/function.that names itself called
as identifiers.
Item_name=”python” # variable name, i.e. also an identifier, and here (identifier) name tell us we
Item_qty=10
Item_sale=230 //here item name are name (or identifier of the variable)
For example:
Age_man=30 #valid
2)Identifier should not start with number or digits in any programming language.
For example:
Marks10=84 #valid
10marks=85 #invalid
3).Python identifiers are case sensitive.(like different name of a variable is consider as a different
variable.like: if you use car variable, so you may not take this variable again in Car name, you have to
take again this variable with same name as you first give car.)
For example:
MARKS=24
4)There is no length limit. But its not recommend to take too lengthy identifier. Remember the name
of the identifier should be reflecting the purpose of the identity.
True, False, None, and, or, not, is, if, elif, else, while, for, break, continue, return, in , yield, Try,
except, finally, raise, form, as, class, def, pass.
Like: only 3 keywords have the upper case(first letter). All others contains have lower case.
Example: a=true #error, because true is a reserve word and first letter is always capital
A=True #valid
-Int, float, etc. data type are not required in python to declare a variable. That’s why they are not
available in python keyword list.
Import keyword #here we import add our module (keyword) form python library
Keyword.kwlist #modulename.keywordlist
Built-in Data types
What is datatype:
-The name data type is represents, the type of data (i.e. that data
must be integer type, float type, long type etc…)
-The type of data (like:1) stored inside a variable.
For example:
10 - int type
100.50 - float type
True or False - Boole type or Boolean type.
-The data types are represents the type of data like: we choose
any kind of data for our program( i.e. that data must be pre-
defined in your program).
-Python is completely object oriented. (i.e. it maintain the real
time data like: it will used to develop real time project (car etc..)
-You do not need to declare(i.e. no need to defined that your
data is an integer type.)
-Every variable in python is an object.(object is model of your
variable ) and variable will work according to your object.