I have a data structure that looks like [("hello", 12), ("yo", 30)]. How do I combine all of the 0th position of each tuple into a string? The output of the above would be like: "helloyo".
Here is what I’ve tried:
' '.join[tuple[0] for tuple in tuples]
Nearly there, this will work:
BTW, don’t use
tupleas a variable, as it’s also a python type.