Question: My code doesn't return anything when i run it , it doesnt display the list of elements and then the list of elements that only

 My code doesn't return anything when i run it , it

My code doesn't return anything when i run it , it doesnt display the list of elements and then the list of elements that only occur once ...... python programming

listofElements=[1,1,5,8,9,6,5,4,7,2,3,5,14,23,12,12,3,4,9,8,7]

#find the ones that occur once

def exactlyOnceInList(listArguments): print("listof elements=",listArguments); onceInList=[] for each in listArguments: if not each in onceInList: onceInList.append(each) return onceInList result= exactlyOnceInList(listofElements); print("occurs once in list=",result);

Problem Write a function that takes a list as an argument and returns a list that only contains items that occurred exactly once in the original list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!