Pranay Kothapalli’s Reviews > Automate the Boring Stuff with Python: Practical Programming for Total Beginners > Status Update
Pranay Kothapalli
is on page 98 of 479
Js Arrays = Python Arrays, assignments to an array are references, not copies.
You need to create an entirely new array if you need to duplicate it(Shallow/Deep copy).
— Jun 12, 2016 09:33PM
You need to create an entirely new array if you need to duplicate it(Shallow/Deep copy).
Like flag
Pranay’s Previous Updates
Pranay Kothapalli
is on page 94 of 479
So, the similarity between Python an JS is that the strings are immutable in the two languages.
— Jun 12, 2016 09:25PM
Pranay Kothapalli
is on page 87 of 479
The Multiple Assignment Trick
The multiple assignment trick is a shortcut that lets you assign multiple vari-
ables with the values in a list in one line of code. So instead of doing this:
>>>
>>>
>>>
>>>
cat = ['fat', 'black', 'loud']
size = cat[0]
color = cat[1]
disposition = cat[2]
you could type this line of code:
>>> cat = ['fat', 'black', 'loud']
>>> size, color, disposition = cat
— Jun 09, 2016 10:17PM
The multiple assignment trick is a shortcut that lets you assign multiple vari-
ables with the values in a list in one line of code. So instead of doing this:
>>>
>>>
>>>
>>>
cat = ['fat', 'black', 'loud']
size = cat[0]
color = cat[1]
disposition = cat[2]
you could type this line of code:
>>> cat = ['fat', 'black', 'loud']
>>> size, color, disposition = cat
Pranay Kothapalli
is on page 87 of 479
'in' and 'not in' operators
a = [1,2,3,4,5]
5 in a
>>>True
10 not in a
>>>True
— Jun 09, 2016 10:15PM
a = [1,2,3,4,5]
5 in a
>>>True
10 not in a
>>>True

