I have this dict, where I manage a list of programs and their different versions
data = {
'soft1':{
'v1':{...},
'v2':{...}
},
'soft2':{
'v1':{...},
'v2':{...}
},
'soft3':{
'v1':{...}
},
...
}
now I need a list like to:
list_=[
'soft1 v1',
'soft1 v2',
'soft2 v1',
'soft2 v2',
'soft3 v1'
]
with list comprehension
list_ = [soft + " " + ver for soft in data.keys() for ver in data[soft].keys()]
but I would like a more efficient method and more pythonic,
I try:
list_ = [map(lambda soft: map(lambda ver: [soft + " " + ver], data[soft].keys()), data.keys())]
but it generates this error
TypeError: can only concatenate str (not "map") to str
I appreciate opinions and corrections