divdude
Aug 5, 2012 10:25 PM
I am spoon feeding you this because this is a little tough for beginner. Not the program part but the
wiring part (command line arguments). So here it goes.
import sys
def dress_me(shirts, ties, suits):
for shirt in shirts:
for tie in ties:
for suit in suits:
print [shirt,tie,suit]
args=sys.argv
_shirts=eval(args[1])
_ties=eval(args[2])
_suits=eval(args[3])
dress_me(_shirts,_ties,_suits)
save it in dressme.py and
python dressme.py ['white','blue'] ['purple','yellow'] ['grey','blue']
you cant have space after comma in the list. Well, you can have
but this program cannot comprehend such sabotage. You may
dig and find a way to do it.