len() i understood. " ".join(cities) --this is something new for me.
So iTried this : >>> cities = [ entry for entry in elements ] >>> " ".join(cities) 'Acatari Acis Adamclisi'
Then as matrix is a list of lists i thought i could do this
dist = [ entry for entry in elements ] >>> print dist [0.0, 183.198428622, 372.526412318]
But when trying to do the same as for cities i got this
Traceback (most recent call last):
File "<pyshell#33>", line 1, in <module> " ".join(dist) TypeError: sequence item 0: expected string, float found
How can this be solved?
As I would like to have something like this.
'Acatari Acis Adamclisi' 0.0 183.198428622 372.526412318
But still i would need a column for the left side from the names of the cities.