for example I have the following list:
contents= [\"i have two pens\",\"prices = 5$\",\"made in ____ and ____\"]
I want to split them such a wa
You would need to check which is the longest array and then pad the other ones, like this:
array = [phrase.split() for phrase in contents] x = max(len(i) for i in array) result = [i + [''] * (x - len(i)) for i in array]
Complicated but gives you the result you're looking for.