To assign a value to a variable is simple because unlike many other languages such as C++ or FORTRAN, in Python, we don't need to define a variable before we assign a value to it.
>>>pv=22 >>>pv+2 24
We could assign the same value to different variables simultaneously. In the following example, we assign 100
to the three variables x
, y
, and z
at once:
>>>x=y=z=100