Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote