str
converts the list
into its string representation. Use map
to convert each number in the list
to str
:
lista = [1,2,3,4,9,5]
print("<".join(map(str, sorted(lista))))
>>> 1<2<3<4<5<9
0
solved Can´t join a list the way I would like
str
converts the list
into its string representation. Use map
to convert each number in the list
to str
:
lista = [1,2,3,4,9,5]
print("<".join(map(str, sorted(lista))))
>>> 1<2<3<4<5<9
0
solved Can´t join a list the way I would like