5
In some languages, it is possible to unite objetos/array
in one.
For example, in PHP, I can join several arrays
thus:
$userInfo = ['name' => 'Wallace']
$jobInfo = ['job' => 'Developer']
$ageInfo = ['age' => '26']
$info = array_merge($userInfo, $jobInfo, $ageInfo)
That would return:
['name' => 'Wallace', 'job' => 'Developer', 'age' => '26']
And in Python? How do I?
If I have the following dictionaries, how can I unite them into one?
a = {"A" : 1}
b = {"B" : 2}
c = {"C": 3}
Note: I thought I’d use the for
already, but I asked the question in order to find a simpler solution than that.
And I’m racking my brain trying to do this in Python 2.7. I’m glad you told me it’s from 3.5..
– Wallace Maxters