Do Learn Python’s Learn the Basics. You can skip the chapters on:
Classes and Objects
Modules and Packages
It’s important that you have a good understanding of these fundamentals - otherwise, the rest of the course will be hard to follow. If you’re feeling lost / find the rest of this assignment challenging, try going through the corresponding topics in one of the Python resources in the next week or so.
To get information from a user, we can use Python’s
word = input("Give me a word: ") word
input() box not (always) showing up? See common issues.
Step 0: Mad lib#
You are going to make a (short) interactive mad lib. Use a paragraph of a story or the chorus from a song, or make one up. Prompt for each of the words (“noun”, “verb”, “vehicle”, etc.), then once they are all entered, it output the mad lib with the provided words filled in. You will be using multiple
inputs() and string concatentation.
# your code here
input() always returns a string. To get a number from a user in Python, you need to convert that input into a integer (or float).
num = input( "Pick a number, any number. Please enter the value without commas or decimals. > " ) num
Step 1: Unemployment benefit eligibility assessment#
We will now make an interactive tool to assess people for unemployment benefits. We will use a simplified set of rules. To be elegible, one must:
Have lost employment
Have made at least $10,000 in the past year
Ask for their salary rather than as a yes-or-no question
Be ready, willing and able to work immediately
Be actively seeking work
Ask the user questions corresponding to the above, then print
"You are eligible" or
"You are not eligible" at the end. You will need:
# your code here
Kaggle is a data science platform that has various tutorials and competitions, which you may want to go back to later. You are welcome to create a Kaggle account to save your progress, but it’s not required.
Kaggle, like JupyterHub, is built around Jupyter notebooks. They are not exactly the same, but will feel similar. Do the following Kaggle tutorial. You do not need to turn this in.
Reminder about the between-class participation requirement.