I'm trying to format a string using values from several lists. The following is pseudo-code but should give an idea of the expected output. The output would be combination of each item in each list: each person likes to eat all fruits while doing all hobbies. So how to do this in python?
There should be len(names)*len(fruits)*len(hobbies) possibilities (64 in my example)
names = ['tom','marry','jessica','john']
fruits = ['oranges','apples','grapes','bananas']
hobbies = ['dancing','sitting','bicycling','watching tv']
print '%(name)s likes to eat %(fruit)s while %(hobby)s \n'
% {'name':names, 'fruit':fruits, 'hobby':hobbies}