Skip to content Skip to sidebar Skip to footer

Converting From Nested Lists To A Delimited String

Disclaimer: I'm new to Python. I have an external service that sends data to us in a delimited string format. It is lists of items, up to 3 levels deep. Level 1 is delimited by '|'

Solution 1:

It is similar to your other method:

def lists_to_dyn(lst):
    return '|'.join(';'.join(','.join(lst3) for lst3 in lst2) for lst2 in lst)

Post a Comment for "Converting From Nested Lists To A Delimited String"