What are variable ? What are the rules for naming a variable?
Answers
the rules and conventions for naming your variables can be summarized as follows:
variable names are case-sensitive. ...
subsequent characters may be letters, digits, dollar signs, or underscore characters. ...
if the name you choose consists of only one word, spell that word in all lowercase letters.
Answer:
• What are Variables?
Variables are the named memory location created in the main memory of computer , used to store data. During the program execution , this location are created and identified by the name given by the user. Using variables, Values are stored and manipulated to produce the desired results.
• What are the Rules for Naming Variables?
To form valid variable name is python, you should always follow certain rules for naming variable. These rules are as follow:
☞ Variable name should be meaningful so that they are easy to remember too.
☞ Variable name can be of any size.
☞ Variable name can have characters a-z, A-Z, 0-9 and Underscore(_).
☞ Variable name should begin with the letter or underscore.
☞ Variable name are case sensitive. e.g. 'total' and 'TOTAL' are not same.
☞ always remember that variable name should be a keyword such as else, print, if, etc.