In Python, how do I print every triple (or groups of n) items in a list?
I have searched and found various solutions using the itertools module for handling pairs, but I have failed to adapt them for groups of three. I will refrain from including my attempts here as I'm uncertain if they are at all indicative of the correct way to go.
Example:
my_list = ["abra", "cada", "bra", "hum", "dee", "dum"]
I would like to print the first triplet in one line, and then the next triplet on the next line:
"Abra cada bra"
"Hum dee dum"
Edit: In order to expand generality, the question has been edited to cover "groups of n items" instead of just triples.