How to declare variable in python?
Variable is nothing but a container to store data. It can be short name like x & y or it can be more descriptive name as name, age, roll_no, etc.
- Variable name should be an alphabet or underscore(_).
- No special characters like @, %, #, etc. can be used in a variable name.
- Variable name s are case sensitive. NAME and name are two different variables.
- The words which are predefined in python cannot be a variable name.
We can easily declare a variable in python.
syntax:-
variable_name= data
e.g.,
x='python' print(x)
e.g.,
website_name='pythonpoint' print(website_name)
In this way we can easily declare variable in python.
Subscribe
Login
Please login to comment
0 Discussion