names = ""
for p in portals: names = names + str(p)
Ie there a one-liner pythonic-way to achieve this ?
names = ""
for p in portals: names = names + str(p)
Ie there a one-liner pythonic-way to achieve this ?
Yes, you can use the str.join() method:
"".join(str(p) for p in portals)
Do note that there is even a more pythonic way to write
names = names + str(p)
and that way is
names += str(p)