Question: You are asked to write a function definition that implements this nickname generator. The function is called nickname_generator() and takes three parameters: adjectives and nouns
You are asked to write a function definition that implements this nickname generator. The function is called nickname_generator() and takes three parameters: adjectives and nouns are two lists of strings, representing adjectives and nouns limit is a number that controls how many times the generator runs. The function returns a list of strings. To better understand what the function does, consider that you'll do the following testing.
You create two lists of adjectives and nouns:
adjectives = ['fabulous', 'squishy', 'evil', 'fuzzy', 'smooth', 'nosy', 'bitter', 'salty', 'mammoth', 'sweet', 'grumpy', 'modern', 'shivering']
nouns = ['elephant', 'phone', 'bug', 'string', 'moon', 'rock', 'dust', 'laptop', 'koala', 'panda', 'mouse']
You call the function, save its return value in the variable nicknames, and print out it as below:
nicknames = nickname_generator(adjectives, nouns, 10) print(nicknames)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
