> for i in range(100,0,-1): > print > print "Go to the store, buy some more" > > I'm curious to know other ways to handle this - could it be done > functionally? How could we obfuscate this (not that we'd want to in > real life)? Or make it a (close to) one liner?
print "".join(['%s bottles of beer on the wall, %s bottles of beer\nTake on down, pass it around..'%(i,i) for i in range(100,0,-1)])+ "\nGo to the store, buy some more" Is a one liner based on your code... Not very obfuscated though... Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor