Python Variables

What is the best computer/programming quote you came across? - Quora

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:
  1. Variable must Start with alphabet or underscore(_).
  2. Variable can't start with Numbers.
  3. A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  4. 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 Variables

Global Variables are those Variables which are mainly used in Function.

For example:-










Comments

Popular Posts