In: Computer Science
Use Python.
Create a Shakespearean Insult Generator
The generator takes one element / data chunk from each list
and
combines them to form the Shakespearean Insult.
For example - List1 - artless
List2 - beef-witted
List3 - barnacle
Result - Thou is a artless beef-witted barnacle
Your program will have three modes.
There is the automatically mode where the program will
randomly
select one element from each column and combine them.
The second mode is the user is presented with each list one at a
time
and the user chooses one insult from each list. The program then
puts
them together.
The third mode is where the user can add or delete an item
from any list they choose. Note you will need print the list so
they can
see the items.
**** PRINT THE LISTS USING A LOOP ****
List1 = ['artless', 'bawdy', 'beslubbering', 'bootless',
'churlish',
'cockered', 'clouted', 'craven', 'currish', 'dankish',
'dissembling',
'droning', 'errant', 'fawning', 'fobbing', 'froward',
'frothy',
'gleeking', 'goatish', 'gorbellied', 'impertinent',
'infectious',
'jarring', 'loggerheaded', 'lumpish', 'mammering', 'mangled',
'mewling', 'paunchy', 'pribbling', 'puking', 'puny',
'qualling',
'rank', 'reeky', 'roguish', 'ruttish', 'saucy', 'spleeny',
'spongy', 'surly', 'tottering', 'unmuzzled', 'vain',
'venomed', 'villainous', 'warped', 'wayward', 'weedy',
'yeasty']
List2 = ['base-court', 'bat-fowling', 'beef-witted',
'beetle-headed',
'boil-brained', 'clapper-clawed', 'clay-brained',
'common-kissing',
'crook-pated', 'dismal-dreaming', 'dizzy-eyed', 'doghearted',
'dread-bolted', 'earth-vexing', 'elf-skinned',
'fat-kidneyed',
'fen-sucked', 'flap-mouthed', 'fly-bitten', 'folly-fallen',
'fool-born', 'full-gorged', 'guts-griping', 'half-faced',
'hasty-witted', 'hedge-born', 'hell-hated', 'idle-headed',
'ill-breeding', 'ill-nurtured', 'knotty-pated',
'milk-livered',
'motley-minded', 'onion-eyed', 'plume-plucked',
'pottle-deep',
'pox-marked', 'reeling-ripe', 'rough-hewn', 'rude-growing',
'rump-fed', 'shard-borne', 'sheep-biting', 'spur-galled',
'swag-bellied', 'tardy-gaited', 'tickle-brained',
'toad-spotted', 'unchin-snouted', 'weather-bitten']
List3 - ['apple-john', 'baggage', 'barnacle', 'bladder',
'boar-pig',
'bugbear', 'bum-bailey', 'canker-blossom', 'clack-dish',
'clotpole',
'coxcomb', 'codpiece', 'death-token', 'dewberry',
'flap-dragon',
'flax-wench', 'flirt-gill', 'foot-licker', 'fustilarian',
'giglet',
'gudgeon', 'haggard', 'harpy', 'hedge-pig', 'horn-beast',
'hugger-mugger', 'joithead', 'lewdster', 'lout',
'maggot-pie',
'malt-worm', 'mammet', 'measle', 'minnow', 'miscreant',
'moldwarp',
'mumble-news', 'nut-hook', 'pigeon-egg', 'pignut', 'puttock',
'pumpion', 'ratsbane', 'scut', 'skainsmate', 'strumpet',
'varlot',
'vassal', 'whey-face', 'wagtail']
"""
The code is given below, If you use copy paste please be carefull because it might mess up the spacing:
Match the spacing as given in images attached:
If you have any problem understanding it, ask in comments below:
import random # to use randomly selecting one item from list
List1 = ['artless', 'bawdy', 'beslubbering', 'bootless', 'churlish',
'cockered', 'clouted', 'craven', 'currish', 'dankish', 'dissembling',
'droning', 'errant', 'fawning', 'fobbing', 'froward', 'frothy',
'gleeking', 'goatish', 'gorbellied', 'impertinent', 'infectious',
'jarring', 'loggerheaded', 'lumpish', 'mammering', 'mangled',
'mewling', 'paunchy', 'pribbling', 'puking', 'puny', 'qualling',
'rank', 'reeky', 'roguish', 'ruttish', 'saucy', 'spleeny',
'spongy', 'surly', 'tottering', 'unmuzzled', 'vain',
'venomed', 'villainous', 'warped', 'wayward', 'weedy', 'yeasty']
List2 = ['base-court', 'bat-fowling', 'beef-witted', 'beetle-headed',
'boil-brained', 'clapper-clawed', 'clay-brained', 'common-kissing',
'crook-pated', 'dismal-dreaming', 'dizzy-eyed', 'doghearted',
'dread-bolted', 'earth-vexing', 'elf-skinned', 'fat-kidneyed',
'fen-sucked', 'flap-mouthed', 'fly-bitten', 'folly-fallen',
'fool-born', 'full-gorged', 'guts-griping', 'half-faced',
'hasty-witted', 'hedge-born', 'hell-hated', 'idle-headed',
'ill-breeding', 'ill-nurtured', 'knotty-pated', 'milk-livered',
'motley-minded', 'onion-eyed', 'plume-plucked', 'pottle-deep',
'pox-marked', 'reeling-ripe', 'rough-hewn', 'rude-growing',
'rump-fed', 'shard-borne', 'sheep-biting', 'spur-galled',
'swag-bellied', 'tardy-gaited', 'tickle-brained',
'toad-spotted', 'unchin-snouted', 'weather-bitten']
List3 =['apple-john', 'baggage', 'barnacle', 'bladder', 'boar-pig',
'bugbear', 'bum-bailey', 'canker-blossom', 'clack-dish', 'clotpole',
'coxcomb', 'codpiece', 'death-token', 'dewberry', 'flap-dragon',
'flax-wench', 'flirt-gill', 'foot-licker', 'fustilarian', 'giglet',
'gudgeon', 'haggard', 'harpy', 'hedge-pig', 'horn-beast',
'hugger-mugger', 'joithead', 'lewdster', 'lout', 'maggot-pie',
'malt-worm', 'mammet', 'measle', 'minnow', 'miscreant', 'moldwarp',
'mumble-news', 'nut-hook', 'pigeon-egg', 'pignut', 'puttock',
'pumpion', 'ratsbane', 'scut', 'skainsmate', 'strumpet', 'varlot',
'vassal', 'whey-face', 'wagtail']
# mode 1st
print("Result: Thou is a",random.choice(List1), random.choice(List2),random.choice(List3))
# mode 2nd
print("Choose any word from the given 1st list: ")
# Using loop to display lists
for word in List1:
print(word)
word1 = str(input())
print("Choose any word from the given 2nd list: ")
for word in List2:
print(word)
word2 = str(input())
print("Choose any word from the given 3nd list: ")
for word in List3:
print(word)
word3 = str(input())
if word1 in List1 and word2 in List2 and word3 in List3:
print("Result: Thou is a",word1,word2,word3)
else:
print("Invalid input, Choose words from list only!")
# mode 3rd
# for deleting from 1st list
print("Enter the word from 1st list to delete: ")
print("List1: ")
for word in List1:
print(word)
delete1 = str(input())
if delete1 in List1:
List1.remove(delete1)
else:
print("Item not in list.")
# for deleting from 2nd list
print("Enter the word from 2nd list to delete: ")
print("List1: ")
for word in List2:
print(word)
delete2 = str(input())
if delete2 in List2:
List2.remove(delete2)
else:
print("Item not in list.")
# for eleting from 3rd list
print("Enter the word from 2nd list to delete: ")
print("List1: ")
for word in List3:
print(word)
delete3 = str(input())
if delete3 in List3:
List3.remove(delete3)
else:
print("Item not in list.")
import random # to use randomly selecting one item from list
List1 = ['artless', 'bawdy', 'beslubbering', 'bootless', 'churlish',
'cockered', 'clouted', 'craven', 'currish', 'dankish', 'dissembling',
'droning', 'errant', 'fawning', 'fobbing', 'froward', 'frothy',
'gleeking', 'goatish', 'gorbellied', 'impertinent', 'infectious',
'jarring', 'loggerheaded', 'lumpish', 'mammering', 'mangled',
'mewling', 'paunchy', 'pribbling', 'puking', 'puny', 'qualling',
'rank', 'reeky', 'roguish', 'ruttish', 'saucy', 'spleeny',
'spongy', 'surly', 'tottering', 'unmuzzled', 'vain',
'venomed', 'villainous', 'warped', 'wayward', 'weedy', 'yeasty']
List2 = ['base-court', 'bat-fowling', 'beef-witted', 'beetle-headed',
'boil-brained', 'clapper-clawed', 'clay-brained', 'common-kissing',
'crook-pated', 'dismal-dreaming', 'dizzy-eyed', 'doghearted',
'dread-bolted', 'earth-vexing', 'elf-skinned', 'fat-kidneyed',
'fen-sucked', 'flap-mouthed', 'fly-bitten', 'folly-fallen',
'fool-born', 'full-gorged', 'guts-griping', 'half-faced',
'hasty-witted', 'hedge-born', 'hell-hated', 'idle-headed',
'ill-breeding', 'ill-nurtured', 'knotty-pated', 'milk-livered',
'motley-minded', 'onion-eyed', 'plume-plucked', 'pottle-deep',
'pox-marked', 'reeling-ripe', 'rough-hewn', 'rude-growing',
'rump-fed', 'shard-borne', 'sheep-biting', 'spur-galled',
'swag-bellied', 'tardy-gaited', 'tickle-brained',
'toad-spotted', 'unchin-snouted', 'weather-bitten']
List3 =['apple-john', 'baggage', 'barnacle', 'bladder', 'boar-pig',
'bugbear', 'bum-bailey', 'canker-blossom', 'clack-dish', 'clotpole',
'coxcomb', 'codpiece', 'death-token', 'dewberry', 'flap-dragon',
'flax-wench', 'flirt-gill', 'foot-licker', 'fustilarian', 'giglet',
'gudgeon', 'haggard', 'harpy', 'hedge-pig', 'horn-beast',
'hugger-mugger', 'joithead', 'lewdster', 'lout', 'maggot-pie',
'malt-worm', 'mammet', 'measle', 'minnow', 'miscreant', 'moldwarp',
'mumble-news', 'nut-hook', 'pigeon-egg', 'pignut', 'puttock',
'pumpion', 'ratsbane', 'scut', 'skainsmate', 'strumpet', 'varlot',
'vassal', 'whey-face', 'wagtail']
# mode 1st
print("Result: Thou is a",random.choice(List1), random.choice(List2),random.choice(List3))
# mode 2nd
print("Choose any word from the given 1st list: ")
# Using loop to display lists
for word in List1:
print(word)
word1 = str(input())
print("Choose any word from the given 2nd list: ")
for word in List2:
print(word)
word2 = str(input())
print("Choose any word from the given 3nd list: ")
for word in List3:
print(word)
word3 = str(input())
if word1 in List1 and word2 in List2 and word3 in List3:
print("Result: Thou is a",word1,word2,word3)
else:
print("Invalid input, Choose words from list only!")
# mode 3rd
# for deleting from 1st list
print("Enter the word from 1st list to delete: ")
print("List1: ")
for word in List1:
print(word)
delete1 = str(input())
if delete1 in List1:
List1.remove(delete1)
else:
print("Item not in list.")
# for deleting from 2nd list
print("Enter the word from 2nd list to delete: ")
print("List1: ")
for word in List2:
print(word)
delete2 = str(input())
if delete2 in List2:
List2.remove(delete2)
else:
print("Item not in list.")
# for eleting from 3rd list
print("Enter the word from 2nd list to delete: ")
print("List1: ")
for word in List3:
print(word)
delete3 = str(input())
if delete3 in List3:
List3.remove(delete3)
else:
print("Item not in list.")
If you find it helpful, please upvote thanks!