Mar-20-2018, 12:18 PM
I'm having problems appending array based on an if statement.
Judith is a man
all_staff = ["Judith", "Harry", "Jonathan", "Reuben"]
new_staff = []
def person_finder(staff):
for x in staff:
if x == "Reuben" or "Harry" or "Jonathan":
new_staff.append(x)
else:
continue
return new_staff
selected = person_finder(all_staff)
def the_men(people):
for x in people:
print(x + " is a man" .format(people))
the_men(selected)This returns:Judith is a man
