To represent the data in Python Programming. we require 3 things -
- 1) Literals
- 2) Data type
- 3) Identifiers/Variables
Literals:- Literals are nothing but input Values passing to the program.
for e.g. →
- Numeric Literals
- Boolean Literals
- String Literals.
- All the literals are stored in main memory by allocating sufficient amount of memory by the help. of data types.
- ัะพ process these Values or literals stored in main memory, as programmer, we must give distinct names to the Created memory Space.
- Since the distinct names makes us to identify the literals/Values for processing hence distinct names. are called "Identifiers".
- Programmatically, Identifier values can Changed during execution of the program and hence Identifiers are called "Variables".
- Hence all types of values or inputs must be Stored in main memory in the form of variables.
========== Definition of Variable ==========
- A Variable is an Identifier, whose values Can be Changed during execution of the program.
- All the Variables in Python are Called Objects.
- Behind of all Objects, There exist a Class.
========== Rules for using Variables in Python Programming ==========
- A Variable name is a Combination of Alphabets, digits and a special symbol ex : Underscore (_)
- The first letter of Variable name must starts with alphabet or Underscore (_)
- Within the Variable name, special Symbols are not allowed except Underscore (_)
4) No Keywords to be used as Variable names because all the keywords are having special meaning to the Language Compilers.
5) All Pre-defined Class names (int, float, etc) Can be used as Variable names.
6) All the Variable name as Case-sensitive.
No comments:
Post a Comment