my_variable1 = 'Blue'
my_variable2 = 'Red'
my_variable3 = 'Black'
my_list = ['House', 'Paint', 'Cloth']
def mergetwo(a, b, s):
return s.join((a,b))
def prefix(item, pre):
return lambda sep: mergetwo(pre,item,sep)
def suffix(item, suf):
return prefix(suf, item)
def mergewith(alist):
return lambda position: lambda sep: lambda var: list(map(lambda item: position(item, var)(sep), alist))
def addprefix_underscore_mylist(var):
return mergewith(my_list)(prefix)('_')(var)
def addsuffix_underscore_mylist(var):
return mergewith(my_list)(suffix)('_')(var)
print(addprefix_underscore_mylist(my_variable1))
print(addprefix_underscore_mylist(my_variable2))
print(addprefix_underscore_mylist(my_variable3))
print(addsuffix_underscore_mylist(my_variable1))
print(addsuffix_underscore_mylist(my_variable2))
print(addsuffix_underscore_mylist(my_variable3))