Data Types in Python
- It is a type of data which is used in the program.
- There is no need of data type to declare a variable in Python.
- type() is predefined function of Python which is used to get data type of any data.
name="Rocky" rollno=205 marks=85.6 print("Name Type:",type(name)) print("Rollno Type:",type(rollno)) print("Marks Type:",type(marks)) """ ***Output*** Name Type: < class str=""> Rollno Type: < class int=""> Marks Type: < class float=""> """
Types of Data Type
- Python contains following data types:
- Numbers
- String
- List
- Tuple
- Dictionary
We will discuss these data types in next post one by one because each data type is a complete topic in itself.
Keywords in Python
- The word which is pre-defined in the library is called keyword.
- It's functionality is also pre-defined.
- Keyword can not be used as a variable, function name ,class name or as an any identifier.
- Example of keywords are if, else, for, def etc.
List of keywords in Python
| asset def class continue break global for if from import nonlocal in not is lambda True False None and as else finally elif del except raise try or return pass |