Variable in python – tutorial # 1
first program in python – tutorial # 1
Video about variables in python
Variable are temporary place to store data and perform operations on data stored. You can do any manipulation.
Variable has 2 parts
- Variable name ( before equal – Left side)
- variable value (after equal – Right side)
variable_name = "Hello"
How to print variable?
It is very very easy. Just use the variable in print
print(variable_name)
Now run the code in terminal and Boom it will work.
Source Code
<div> <div>variable_name = "Hello"</div> <div># 2nd variable</div> <div>person_name = "Khan"</div> <div># Now I will print my variable</div> <div># No need to make big big variable names :P</div> <div>print(variable_name)</div> <div># lets print 2nd variable</div> <div>print(person_name)</div> <div># Let run the program in terminal</div> <div># I want to change my variable name</div> <div># Lets run again.</div> </div>