Variable Naming Rules
- Variable name can be a combination of alphabet,number and underscore( _ ).
- Variable name can't start with digits.
- Variable names are case-Sensitive language.(means that ex- pramod and PRAMOD are treated as differently.
- Keywords can't be used as Variable Name.
- Other language like c ,c++,java is statically typed language.but python is a dynamically typed language.(Let us understand by an example
- x=5 (int type)
- After some line of code we also write x=6.4( float type)
- After some code we can change the the value x="Pramod"
Important Points
- Not only the value of a variable, we can also change the data type of a variable .
x=3.5
Now,Here at first we assign the int type value in x.After some we assign the float value in the same variable x in the same program.
Comments
Post a Comment