Skip to content

Commit 80c9cd5

Browse files
committed
chapter 09
1 parent b36685a commit 80c9cd5

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

09_abuse/abuse.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
import argparse
44
import random
55

6+
adj = """bankrupt base caterwauling corrupt cullionly detestable dishonest false
7+
filthsome filthy foolish foul gross heedless indistinguishable infected insatiate
8+
irksome lascivious lecherous loathsome lubbery old peevish rsacaly rotten
9+
ruinous scurilous scurvy slanderous sodden-witted thin-faced toad-spotted
10+
unmannered vile wall-eyed""".strip().split()
11+
12+
assert len(adj) == 36
13+
14+
nouns = """Judas Satan ape ass barbermonger beggar blsck boy braggart butt
15+
carbuncle coward coxcomb cur dandy degenerate fiend fishmonger fool gull harpy
16+
jack jolthead knave liar lunatic maw milsop minion ratcatcher recreant togue
17+
scold slave swine traitor varlet villain worm""".strip().split()
18+
19+
assert len(nouns) == 39
20+
621
def get_args():
722

823
parser = argparse.ArgumentParser(
@@ -38,12 +53,15 @@ def get_args():
3853
return args
3954

4055
def main():
56+
57+
4158
args = get_args()
4259

4360
random.seed(args.seed)
4461

45-
print(random.randint(0,1000))
46-
62+
for i in range(args.number):
63+
#print('You {} {}!'.format(', '.join(random.choices(adj, k = args.adjectives)), random.choice(nouns)))
64+
print('You ' + ', '.join(random.sample(adj, k = args.adjectives)) + ' ' + random.choice(nouns) + '!')
4765

4866
if __name__ == '__main__':
4967
main()

0 commit comments

Comments
 (0)