def rm_duplicates_loop(list_name):
new_list = []
#new_list=[num for num in list_name if num not in new_list]
for num in list_name:
if num not in new_list:
new_list.append(num)
return new_list
In the function rm_duplicates_loop(list_name) why does the new list list comprehension method is not showing the same exact output as the for loop?
As far as I know, theoretically it should be the same thing in different method resulting the same thing.