Nov-09-2021, 04:00 PM
Wow... OK now I understand!! Many thanks, I was becoming crazy complicating thing and looping my brain instead of coding, now it finally works as expected (below the correct code). Many thanks again, in particular with the details: they helped me to understand things more linearly.
def main(list_1): return main list_1 = [ {'name': 'Jerome', 'weight': 3.38, 'wingspan': 49.96, 'length': 19.75}, {'name': 'Ibraheem', 'weight': 3.08, 'wingspan': 50.59, 'length': 20.6}, {'name': 'Tiana', 'weight': 0.81, 'wingspan': 47.86, 'length': 17.94}, {'name': 'Lucas', 'weight': 3.33, 'wingspan': 48.27, 'length': 18.77}, {'name': 'Rickie', 'weight': 4.4, 'wingspan': 51.0, 'length': 20.34} ] def get_data(data,key): y = [] for x in data: y.append(x[key]) return y data = list_1 get_data(list_1,'length') output = get_data(list_1, 'length') print(output, end=" ")