1.What is a variable
A variable can be a empty container in which we can store some data.
2.Points to remember while declaring a variable
- The variable name may start with a underscore or a letter.
It can not start with a digit or a symbol. For example-7,4,%,!,?,etc.
Variable can only contain letters, underscores, or a digit after a digit. For example-a=10
a_2=12,etc.
3.Examples
1.
num1_list1=['science', 'history', 'mathematics']
print(num1_list1)
Output:
['science', 'history', 'mathematics']
2.
_123=("dev community")
print(_123)
Output:
dev community
3.
foo="Hello"
print(foo)
Output:
Hello
4.
my_tuple = (1, 2, 3, 4)
print (len(my_tuple))
Output:
4
Top comments (0)