Variable: -
Python, allow us to declare a variable with any data type.
A variable in a program is uniquely identified by a name (identifier). Variable in Python refers to
an object — an item or element that is stored in the memory. Value of a variable can be a string
(e.g., ̳b‘, ̳Global Citizen‘), numeric (e.g., 345) or any combination of alphanumeric characters
(CD67). In Python an assignment statement is used to create new variables and assign specific
values to them.
gender = 'M'
message = "Keep Smiling"
price = 987.9
1> Assign Integer variable: -
age=5
print (age)
Output :-
10
age=10
print (age)
Output:-
10
my_age=30
print (my_age)
Output :-
30
1> Assign Float variable: -
fl=2.17
print (fl)
Output:-
2.17