I have a question about a list that return True if only all elements in list1 appear in list2 otherwise you get false. What am I need to append to this code to find if all elements in list 1 appear in list 2.
def in_list(list1,list2):
for i in list1:
if i in list2:
return True
else:
return False
print(in_list(['x',2,4.5,'a'],[5,4.5,'a','x',29,'Hello',2,75]))
print(in_list(['Y',22,4,],[5,4.5,'a','x',29,'Hello',2,75]))
i get the second false but if i append parameter to list1 that show in list2 i get True