# Python's built-in map(function, list ) function applies a # function to a list of values. If you're thinking: 'hey, # that sounds like a for loop', you're correct. FP eschews # using transient variables as counters in favor of constructs # like map( ) import string def toUpper(x): return string.upper(x) namelist = ['xavier', 'jean grey', 'cyclops', 'frost'] mappableFunction = lambda x: string.upper(x) s = "hello" print string.upper(s) print map(mappableFunction, namelist) print map(toUpper, namelist)