By Vasudev Ram
Hi reader [1],
Analyze the snippet of Python code below. See what you make of it.
I will discuss it in my next post.
>>> a = 1
>>> lis = [a, 2 ]
>>> lis
[1, 2]
>>> lis = [a, 2 ,
... "abc", False ]
>>>
>>> lis
[1, 2, 'abc', False]
>>> a
1
>>> b = 3
>>> lis
[1, 2, 'abc', False]
>>> a = b
>>> a
3
>>> lis
[1, 2, 'abc', False]
>>> lis = [a, 2 ]
>>> lis
[3, 2]
>>>
[1] This product is suitable for Pythonistas aged 1 to 2 (approximately). For those of higher age, the dose may have no effect :)
- Vasudev Ram - Online Python training and consulting
Are you a blogger with some traffic? Get Convertkit:Email marketing for professional bloggersGet updates (via Gumroad) on my forthcoming apps and content. Jump to posts: Python * DLang * xtopdfSubscribe to my blog by emailMy ActiveState Code recipesFollow me on: LinkedIn * Twitter
Hi reader [1],
Analyze the snippet of Python code below. See what you make of it.
I will discuss it in my next post.
>>> a = 1
>>> lis = [a, 2 ]
>>> lis
[1, 2]
>>> lis = [a, 2 ,
... "abc", False ]
>>>
>>> lis
[1, 2, 'abc', False]
>>> a
1
>>> b = 3
>>> lis
[1, 2, 'abc', False]
>>> a = b
>>> a
3
>>> lis
[1, 2, 'abc', False]
>>> lis = [a, 2 ]
>>> lis
[3, 2]
>>>
[1] This product is suitable for Pythonistas aged 1 to 2 (approximately). For those of higher age, the dose may have no effect :)
- Vasudev Ram - Online Python training and consulting
Are you a blogger with some traffic? Get Convertkit:Email marketing for professional bloggersGet updates (via Gumroad) on my forthcoming apps and content. Jump to posts: Python * DLang * xtopdfSubscribe to my blog by emailMy ActiveState Code recipesFollow me on: LinkedIn * Twitter