Skip to content

Commit

Permalink
Clean up 8.02
Browse files Browse the repository at this point in the history
  • Loading branch information
epequeno committed Oct 22, 2015
1 parent b3640c5 commit 6ef6283
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ch08/8.02.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
prefixes = 'JKLMNOPQ'
suffix = 'ack'


def ducks():
for i in prefixes:
if i == "O" or i == "Q":
print i + "u" + suffix
for p in prefixes:
if p == "O" or p == "Q":
yield '{}uack'.format(i)
else:
print i + suffix
yield '{}ack'.format(i)

ducks()
for i in list(ducks()):
print i

0 comments on commit 6ef6283

Please sign in to comment.