View Single Post
Old Mar 28th, 2005, 2:47 PM   #3
Moldz
Programmer
 
Moldz's Avatar
 
Join Date: Feb 2005
Posts: 54
Rep Power: 4 Moldz is on a distinguished road
I'm not sure if they covered lists at that point, but you could also do:
prefix = ['J', 'K', 'L', 'M', 'N', 'Ou', 'P', 'Qu']
suffix = 'ack'
for letter in prefix:
    print letter + suffix
Your solution works, but it's not the easiest code to maintain. Try adding a few prefixes to both codes and see which is easier to modify, ie - make it also say Tack, Uack, Vack. Which is easier?
Moldz is offline   Reply With Quote