In this section we will specifically expand the variable assignment
1. Below we give a sample of various assignments
Anint=12anfloat=2.2anstr= ' string ' alist=[' a ', ' a ', ' a ']anarray= (all-in-all) Amap={1: ' A ', 2: ' B ', 3: ' C ',}
2. Chained assignment
Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">
3. Increment assignment. i.e. self-increment or self-reduction, etc.
These operators: +=,-=,*=,/=,%=,**=,>>=. <<=. &=,|=
X+=1x=x+1x*=1
4. Multi-value Assignment
Using tuples to assign multiple values
A,b,c,d= (1,2,3,4)
5. Variable Exchange
Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">
Here we are, thank you.
------------------------------------------------------------------
Click the jump 0 Basic python-folder
0 Basic python-3.2 variable assignment