Variables
In programming language, Variable is a name which is given to a memory location where the data is being stored.
For example: Suppose in our kitchen we have different container for storing things such as - Daal, Sugar, Salt, etc. and we put name sticker on containers. So container will memory location and name on container is variable name and item in container is our data.
Things to remember :
-
Variable name cannot be start with a number (for ex: 5T- this is wrong way) , It always start with an alphabet. such as A2, box1, M16A. These are
correct way.
- We cannot put spaces between variables , but we can put underscore for example: Player_Name, Roll_no, etc.
- We cannot put any symbol or full stop or coma in variable name.
We can declare variables (means creating a variable) in like
this:
A= 25
Name = James
Exam_score= 13
This is a python code for declaring a variable----
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Student_Name= "Radhe bhai" | |
Age= 31 | |
print(Student_Name) # print() used displays the output | |
print(Age) |
0 Comments