Module 1 Required Coding Activity
Introduction to Python Unit 1
This Activity is intended to be completed in the jupyter notebook, Required_Code_MOD1_IntroPy.ipynb, and then pasted into the assessment page that follows.
All course .ipynb Jupyter Notebooks are available from the project files download topic in Module 1, Section 1.
This is an activity from the Jupyter Notebook Practice_MOD01_1-2_IntroPy.ipynb which you may have already completed.
Assignment Requirements
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
Program: Allergy Check
[ ] get user input for categories of food eaten in the last 24 hours
save in a variable called input_test
example input 01 02 practice Allergy-input
[ ] print True if "dairy" is in the input_test string
[ ] Test the code so far
[ ] modify the print statement to output similar to below
example output 01 02 Allergy output
Test the code so far trying input including the string "dairy" and without
[ ] repeat the process checking the input for "nuts", challenge add "Seafood" and "chocolate"
[ ] Test your code
[ ] challenge: make your code work for input regardless of case, e.g. - print True for "Nuts", "NuTs", "NUTS" or "nuts"
Create Allergy check code
then PASTE THIS CODE into edX
[ ] get input for input_test variable
[ ] print "True" message if "dairy" is in the input or False message if not
[ ] print True message if "nuts" is in the input or False if not
[ ] Challenge: Check if "seafood" is in the input - print message
[ ] Challenge: Check if "chocolate" is in the input - print message
Important: How to submit code by pasting
Sur cette page du site, vous pouvez voir la vidéo en ligne Module 1 Required Code Description - Introduction to Python: Absolute Beginner Module 1 Video 24 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Book Simplifiers 29 juillet 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 202 fois et il a aimé 13 téléspectateurs. Bon visionnage!