Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (47.6k points)

I need to join a list of items. Many of the items in the list are integer values returned from a function; i.e.,


How should I convert the returned result to a string in order to join it with the list?

Do I need to do the following for every integer value:


Is there a more Pythonic way to solve casting problems?

1 Answer

0 votes
by (106k points)

You can use the below-mentioned code to join a list of items with different types as a string in Python:-


b=[str(x) for x in a] 

print b

Related questions

0 votes
1 answer
0 votes
1 answer

Browse Categories