VARIABLES:
v A variable allows us to store a value by
assigning it to a name, which can be used later.
v Named memory locations to store values.
v Programmers generally choose names for their
variables that are meaningful.
v It can be of any length. No space is allowed.
v We don't need to declare a variable before
using it. In Python, we simply assign a value to a variable and it will exist.
Value should be
given on the right side of assignment operator(=) and variable on left side.
>>>counter =45
print(counter)
Assigning a
single value to several variables simultaneously:
>>> a=b=c=100
Assigning
multiple values to multiple variables:
>>>
a,b,c=2,4,"ram"
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.