2. Implement a function excludeName() that takes two parameters, the first a lis
ID: 639475 • Letter: 2
Question
2. Implement a function excludeName() that takes two parameters, the first a list of string representing a set of names and the second a string representing a particular name. The function prints every name in the list that is not equivalent to the second parameter. Not equivalent here means when capitalization is disregarded, the name in the list is not the same as the name provided as the second parameter. The information below shows you how you would call the function excludeName() and what it would display for several sample executions:Explanation / Answer
def excludeName( names , excludeName):
for item in names:
if item != excludeName:
print item
excludeName(['a', 'b', 'c', 'd', 'a'], 'a')
--------------------------
OUTPUT
C:UsersdeDesktopPython>python sample.py
b
c
d
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.