Aug-05-2017, 02:10 PM
The first argument of map is the function which is called repeatedly with the elements of the iterable. Don't call the function when you pass it to a map function.
def name_split(name): return name.split() people = ['Dr. Christopher Brooks', 'Dr. Kevyn Collins-Thompson', 'Dr. VG Vinod Vydiswaran', 'Dr. Daniel Romero'] splitted_names = list(map(name_split, people)) print(splitted_names)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!