Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON 3.6 Problem 12 Part A (12 points) Write a function named containsLetter) that identifies all of the strings in a list that contain a
PYTHON 3.6
Problem 12 Part A (12 points) Write a function named containsLetter) that identifies all of the strings in a list that contain a specified letter and returns a list of those strings The function containsLetter() takes two parameters: 1. a string of length 1, aLetter 2. a list of strings, strList For example, the following would be correct output: >>> hulkLine = ["you", "wouldn't", "like", "me", "when", "i"m", "angry"] >>> searchLetter li! >>>print (containsLetter(searchLetter, hulkLine)) Problem 12 Part B (8 points) Write code that calls containsLetter) for each letter in 'hulk'. Each function call should pass one of the letters in 'hulk' and the string hulkLine as parameters. After each function call your code should print the list of words returned by containsLetter(). For full credit, you must put the call to containsLetter() inside of a for loop The following would be correct output. ["you", "would ["wouldn't" "like" 1 ["like"1 n't"]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started