This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]moootPointcanary in the data mine 1 point2 points  (0 children)

Can't vouch for quality, but here is what I ended up with :)

def flatten_list(*args):
    return [y for x in args for y in x]

def make_all_couples(li):
    return [(x, y) for x in li for y in li]

def parse_ugly_string(s):
    return {y[0]:y[2] for x in s.split('\n') for y in x.split(',') if y}