# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# #  Module 1 Required Coding Activity  
# Introduction to Python Unit 1
#
# This is an activity from the Jupyter Notebook **`Practice_MOD01_1-2_IntroPy.ipynb`** which you may have already completed.
#
# > **NOTE:** This program requires print output and code syntax used in module 1
#
# | Some 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  
#
# 1. **[ ]** 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](https://iajupyterprodblobs.blob.core.windows.net/imagecontainer/eaten_input.gif) ](https://1drv.ms/i/s!Am_KPRosgtaij65qzFD5CGvv95-ijg)
# &nbsp;  
# 2. **[ ]** print **`True`** if "dairy" is in the **input_test** string  
# **[ ]** Test the code so far  
# &nbsp;
# 3. **[ ]** modify the print statement to output similar to below  
# *example output*
# [![01 02 Allergy output](https://iajupyterprodblobs.blob.core.windows.net/imagecontainer/eaten_output.gif) ](https://1drv.ms/i/s!Am_KPRosgtaij65rET-wmlpCdMX7CQ)  
# Test the code so far trying input including the string "dairy" and without  
# &nbsp;  
#
# 4. **[ ]** repeat the process checking the input for "nuts", **challenge** add "Seafood" and "chocolate"  
# **[ ]** Test your code  
# &nbsp;  
#   
# 5. **[ ] challenge:** make your code work for input regardless of case, e.g. - print **`True`** for "Nuts", "NuTs", "NUTS" or "nuts"  
#

# +
# Create Allergy check code

# [ ] get input for input_test variable
input_test = input("Enter food eaten in the past 24 hours: ")

# [ ] print "True" message if "dairy" is in the input or False message if not
print("It is ", "dairy" in input_test.lower(), "that", input_test.lower(), "contains 'dairy'")

# [ ] print True message if "nuts" is in the input or False if not
print("It is ", "nuts" in input_test.lower(), "that", input_test.lower(), "contains 'nuts'")
# [ ] Challenge: Check if "seafood" is in the input - print message
print("It is ", "nuts" in input_test.lower(), "that", input_test.lower(), "contains 'nuts'")

# [ ] Challenge: Check if "chocolate" is in the input - print message
print("It is ", "chocolate" in input_test.lower(), "that", input_test.lower(), "contains 'chocolate'")
# -

# Submit this by creating a python file (.py) and submitting it in D2L. Be sure to test that it works.

StarcoderdataJupyterScriptsDedupFiltered