|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": { |
| 6 | + "collapsed": true |
| 7 | + }, |
| 8 | + "source": [ |
| 9 | + "# Module 1 Required Coding Activity \n", |
| 10 | + "Work through the Module 1 Tutorials and Practices prior to attempting this activity.\n", |
| 11 | + "\n", |
| 12 | + "> **NOTE:** This program requires print output and code syntax used in module 1\n", |
| 13 | + "\n", |
| 14 | + "| Some Assignment Requirements | \n", |
| 15 | + "|:-------------------------------| \n", |
| 16 | + "| **NOTE:** This program requires `print` output and using code syntax used in module 1 such as variable assignment, `input`, `in` keyword, `.lower()` or `.upper()` method | \n", |
| 17 | + "\n", |
| 18 | + "\n", |
| 19 | + "## Program: Allergy Check \n", |
| 20 | + "\n", |
| 21 | + "1. **[ ]** get user **`input`** for categories of food eaten in the last 24 hours \n", |
| 22 | + " save in a variable called **input_test** \n", |
| 23 | + "2. **[ ]** print **`True`** if \"dairy\" is in the **input_test** string \n", |
| 24 | + "3. **[ ]** Test the code so far \n", |
| 25 | + "4. **[ ]** repeat the process checking the input for \"nuts\", **challenge** add \"Seafood\" and \"chocolate\" \n", |
| 26 | + "5. **[ ]** Test your code \n", |
| 27 | + "6. **[ ] challenge:** make your code work for input regardless of case, e.g. - print **`True`** for \"Nuts\", \"NuTs\", \"NUTS\" or \"nuts\" \n" |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + "cell_type": "code", |
| 32 | + "execution_count": 1, |
| 33 | + "metadata": { |
| 34 | + "collapsed": true |
| 35 | + }, |
| 36 | + "outputs": [], |
| 37 | + "source": [ |
| 38 | + "# Create Allergy check code\n", |
| 39 | + "\n", |
| 40 | + "# [ ] get input for input_test variable\n", |
| 41 | + "\n", |
| 42 | + "# [ ] print \"True\" message if \"dairy\" is in the input or False message if not\n", |
| 43 | + "\n", |
| 44 | + "\n", |
| 45 | + "# [ ] print True message if \"nuts\" is in the input or False if not\n", |
| 46 | + "\n", |
| 47 | + "\n", |
| 48 | + "# [ ] Challenge: Check if \"seafood\" is in the input - print message\n", |
| 49 | + "\n", |
| 50 | + "\n", |
| 51 | + "# [ ] Challenge: Check if \"chocolate\" is in the input - print message" |
| 52 | + ] |
| 53 | + }, |
| 54 | + { |
| 55 | + "cell_type": "markdown", |
| 56 | + "metadata": {}, |
| 57 | + "source": [] |
| 58 | + }, |
| 59 | + { |
| 60 | + "cell_type": "markdown", |
| 61 | + "metadata": {}, |
| 62 | + "source": [ |
| 63 | + "When finished and tested, copy your code to the clipboard on your computer. Then, create a python file (.py) in Visual Studio Code by selecting New File and saving the file with a .py extension. Then, paste in your code and test it. Finally, save the file and upload it to D2L to submit. Be sure to test that it works. Use this same process for all Required Code Activities." |
| 64 | + ] |
| 65 | + } |
| 66 | + ], |
| 67 | + "metadata": { |
| 68 | + "kernelspec": { |
| 69 | + "display_name": "Python 3", |
| 70 | + "language": "python", |
| 71 | + "name": "python3" |
| 72 | + }, |
| 73 | + "language_info": { |
| 74 | + "codemirror_mode": { |
| 75 | + "name": "ipython", |
| 76 | + "version": 3 |
| 77 | + }, |
| 78 | + "file_extension": ".py", |
| 79 | + "mimetype": "text/x-python", |
| 80 | + "name": "python", |
| 81 | + "nbconvert_exporter": "python", |
| 82 | + "pygments_lexer": "ipython3", |
| 83 | + "version": "3.8.8" |
| 84 | + } |
| 85 | + }, |
| 86 | + "nbformat": 4, |
| 87 | + "nbformat_minor": 1 |
| 88 | +} |
0 commit comments