Welcome to the Treehouse Community
Looking to learn something new?
I'm not sure why I didn't get the expected output, please help.
I'm not sure if I misread the question but I got the question wrong
num_list =  str_list =  def combiner(stuff_list): for item in stuff_list: if isinstance(item, (int, float)) == True: num_list.append(item) else: str_list.append(item) continue new_str_list = ''.join(str_list) for i in range(0, (len(num_list)-1)): add_list = num_list[i] + num_list[i+1] new_add_list = str(add_list) final_list = new_str_list + new_add_list new_final_list = str(final_list) return new_final_list
Steven Parker216,083 Points
The numeric accumulation loop doesn't do what you intended. Luckily, there's a built-in function that will do exactly what is needed:
# replace these lines: for i in range(0, (len(num_list)-1)): add_list = num_list[i] + num_list[i+1] # with this: add_list = sum(num_list)
That should be enough to pass the challenge, but if you wanted some extra practice there are several other ways this function can be optimized.