Home » Python » Join a list of items with different types as string in Python

Join a list of items with different types as string in Python

Posted by: admin October 4, 2018 Leave a comment

Questions:

I need to join a list of items. Many of the items in the list are integer values returned from a function. ie:

myList.append(munfunc()) 

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:

myList.append(str(myfunc()) 

Is there a more Pythonic way to solve casting problems?

Answers: