name = "Devansh"
age = 20
marks = 80.50
print(name)
print(age)
print(marks)
This syntax can be used to declare both local and global variables.
In the above example, we have declared a few valid variable names such as name, _name_ , etc.
But it is not recommended because when we try to read code, it may create confusion. The
variable name should be descriptive to make code more readable.
x=y=z=50
print(x)
print(y)
print(z)
Note: If you assign a new value to an existing variable, it
will overwrite the previous value:
If you don't want others (or yourself) to overwrite existing values, use the final keyword (this will declare the variable as "final" or "constant", which means unchangeable and read-only):
x = "mohan"
y = True
z = 4.9
print(x)
print(y)
print(z)