python return only first element of tuples from list of tuples code example
Example: how to extract the first elements from a list of tuples
tuple_list = [("a", "b"),("c", "d")]
first_tuple_elements = []
for a_tuple in tuple_list:
first_tuple_elements.append(a_tuple[0])
print(first_tuple_elements)
#OUTPUT: ['a', 'c']