>Well you did come up with a way that would work sort of and you seem to be
>ont eh right track. I would make 1 small change if using your approach.
>
>prefixes = 'JKLMNOPQ'
>suffix = 'ack'
>
>for letter in prefixes:
>  if letter == 'O' or letter == 'Q': print letter + 'u' + suffix
>  else: print letter + suffix
>
>However there are other methods to solve this problem but following the
>logic you are using this works.

>Jeff

I also learned an easier way to do that:

prefixes = 'JKLMNOPQ'
suffix = 'ack'

for letter in prefixes:
  if letter == ('O') or ('Q'):
        print letter + 'u' + suffix
  else:
        print letter + suffix

Joseph Q.


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to