8
When I want to unite a array
in PHP, I use the function array_merge
Thus:
$a = [1, 2, 3];
$b = [4, 5, 6];
array_merge($a, $b);
Upshot:
[1, 2, 3, 4, 5, 6]
And how could I do that in Python in a list
(I think a list
is equivalent to array
in PHP, if I’m not mistaken)?
Example:
a = [1, 2, 3]
b = [4, 5, 6];
I always forget that I’m not in PHP! there are problems if I forget one
;
down in the code?– Wallace Maxters
It is accepted without causing problems because you may want to put several statements on the same line. But it gets weird to use at the end of the single line.
– Maniero
... Since in python the organization is made by identation... Full sentence
– Wallace Maxters
Cloudflare is screwing with me today, I’m late because I can’t access the site. It’s been almost a week. http://meta.pt.stackoverflow.com/q/4225/101
– Maniero