Python Variables
A variables is a location in memory used to store value.they are given unique names to differentiate between different memory location. the rules for writing a variable name is same as the rules for writing identifiers in python.
In python do not need to declare a variable before using it.in python,we simply assign a value to a variable and it will exist.we don't even have to declare the type of the variable.this is handled internally according to the type of value we assign the variable.
Example
>>> a = 10;
>>> print(a);
Variable Names
A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume). Rules for Python variables:
- A variable name must start with a letter or the underscore character
- A variable name cannot start with a number
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
- Variable names are case-sensitive (age, Age and AGE are three different variables)
I hope this tutorial helped you Python Variables. As always, if you found this post useful, then subscribe to our free newsletter. You can also follow us on Google+, Twitter or like our Facebook page.
0 comments:
Post a Comment