Pick a Random Adverb
00:00 Okay, the final random word that you still need to pick is one adverb. So you’re going to work with the adverbs list, which sits at index four of my words tuple, and I just need to pick out one.
So this is working. One thing to note here is that I have not added this to a list. So the adverb is different to the other ones in that sense.
adjectives is a list,
prepositions is a list,
nouns is a list, and
verbs is a list.
01:16 However, adverb is just a string because I’m just picking out one. So depending on the program that you’re writing, it might make sense that you, even if this is just one element, you might want to wrap it inside of a list.
02:20 and three nouns. There we got it. Three nouns, three verbs, three adjectives using list comprehension, two prepositions, and one adverb. Cool. I’m going to keep it a bit cleaner, but that means we should have access to all the words that you are going to need to create the poem following this structure down here.
Become a Member to join the conversation.