def mapScale(factor,nums):
# Can't define this outside of mapScale, because
# it needs to refer to parameter named "factor"
	def scale(n):
		return factor*n
	return map (scale, nums)

list(mapScale(3, [8,3,6,7,2,4]))

# Using the map function, define a mapPreConcat function that takes a string
# pre and a list of strings and returns the result of concatenating pre
# in front of every string in the list.
def mapPreConcat(pre, strings):
	def preConcat(s):
		return pre+s
	return map(preConcat,strings)

list(mapPreConcat('abc',['def','ABC','xyz']))
