Create Collections of Words
00:00 So I want to get started with creating the words lists, and I just went ahead and copy/pasted these from the slides. You can do that as well, because otherwise, it’s a lot to write out.
00:09 So there are some nouns, there are some verbs, some adjectives, some prepositions, and some adverbs, each in their own list. And it’s a list of strings with these words each in there.
00:22
Actually, I think I’m going to wrap them again into a data structure. So I’m going to create a words
tuple, and I’ll put in all of these lists: nouns
, verbs
, adjectives
,
00:38
prepositions
, and adverbs
.
00:44
Why am I doing this? I think it’ll make it easier to pass around this one variable. I’m kind of planning to probably write a function that handles poetry creation, and then I imagine I’m going to put words
probably as the argument to that function.
01:05 And then I can inside of there, I can pick apart and go to all the different lists. So yeah, creating a container for all of these different words, which are all words that I’m going to use in the poem.
01:18 To me, this makes sense. We’ll see if I stick with it, I might refactor along the way, but for now, this seems like a good way to start in the way that I’m imagining this script to go.
01:30 Great. I’ve created the words lists. I’m going to get rid of this comment because I’m done with it. And then in the next lesson, I’m going to start with implementing some logic.
Become a Member to join the conversation.