In the cinema's seat list, an empty seat is an empty string "", or sometimes just spaces " ". Write taken_seats(seats) to return the names in the taken seats (with spaces trimmed off each name), in the same order.
taken_seats(["Lily", "", "Max", ""])→['Lily', 'Max']taken_seats([" ", " Ivy ", ""])→['Ivy']taken_seats(["", ""])→[]def taken_seats(seats):
names = []
for seat in seats:
name = seat.strip()
# your code here: if name is not empty, add it to names
pass
return names
Run tries the examples. When they look right, Submit.