Answers for "python concatenate tuple to string"

0

python concatenate tuple to string

# initializing the list with tuples
string_tuples = [('A', 'B', 'C'), ('Tutorialspoint', 'is ', 'popular')]
# function that converts tuple to string
def join_tuple_string(strings_tuple) -> str:
   return ' '.join(strings_tuple)
# joining all the tuples
result = map(join_tuple_string, string_tuples)

# converting and printing the result
print(list(result))		# ['A B C', 'Tutorialspoint is popular']
Posted by: Guest on May-13-2021

Code answers related to "python concatenate tuple to string"

Python Answers by Framework

Browse Popular Code Answers by Language