I have a dictionary. I am trying to join the values only. This is the dictionary:
d = {'x': 1, 'y': 2, 'z': 3}
My expected output is 123
(it should be 123 without any sorting).
The code I am using:
d = {'x': 1, 'y': 2, 'z': 3}
test = ' '.join(d.values())
print test
It is showing an error:
Traceback (most recent call last):
File "test.py", line 2, in <module>
test = ' '.join(d.values())
TypeError: sequence item 0: expected string, int found
I am using Python 2.x.