My data is organized like this:
d={1: [44, 56.5238], 2: [63, 56.8663], 3: [93, 55.7313], 4: [112, 55.5425]} I want to create list with first values in these small lists:
new_list=[44, 63, 93, 112] My ugly way to do it:
new_list=[] for item in d.values(): new_list.append(item[0]) Can I do it in better and shorter way, may be in one line?
new_list = [item[0] for item in d.values()]?