```py def sort_by_type(a): d_types = {int:[], float:[], str:[]}, for x in a: if type(x) in d_types: d_types[type(x)].append(x) return d_types[int]+d_types[float]+d_types[str] a = ['python', 3.14, 'programming', 1, 89.18, 'ciao', 9] print(sort_by_type(a)) ``` Could somebody please explain to me why the return function returns a list?
What type are you expecting it to return?