Python Variables
Creating a Variable:-
A Variable is a Container for Store a value.
Variables do not need to be declared with any particular type and can even change type after they have been set.
Variable Names
A variable should have its Logical name like (a & b) or more descriptive names like (age,name,car_name etc.)
Rules for Declaring Python variables:
- Variable must Start with alphabet or underscore(_).
- Variable can't start with Numbers.
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
- Variable is Case-Sensitive.
Assign Value to Variables
To assign the value we must have a logical variable to assign the value.
Assigning Multiple Values to Multiple Variables
Global VariablesGlobal Variables are those Variables which are mainly used in Function. For example:- |
Comments
Post a Comment