College for Kids - Python: Lab 1

In this lab you will be creating a madlib. I have provided some default code for you. Follow the directions and then we will present to the class. If you finish before the class is ready to present then you may work on the advanced version or play computer games while you respectfully wait.

Download the following file
First using what you have learned about variables declare 19 variables
Madlib Lab

If you have already finished the lab follow the instructions below for an advanced version of the madlib lab.

In programming there is something that we call lists. It is exactly like your familiy's grocery list! It is just something that contains a bunch of items. However, in Python these lists can store things other than just grocery itmes. For example we can have a list of numbers and that would look like [3, 4, 5]. Lists work just like variables where I can save the value into a name. For example, numbers = [3, 4, 5] then if I wanted to get the number 3 I would say numbers[0]. Coding is weird and counting usually starts at 0 and not one. We can add and delete things to lists but for right now all you need to know is to add to a list I would say numbers.append(6).

Your goal for this lab is to use lists and the random library to generate a random madlib. Make sure to read the documentation of the random library before you start. And dont worry, we will talk about libraries later

For this lab you will store lists of nouns, adjectives, adverbs and whatever else you need. You should ask the user for these and then put them in your list. Then when filling out the madlib one gets randomly selected.