Jul-08-2020, 07:38 AM
I want to compare the elements of two list and the code to return True if all of the elements in the second list is present in the first. The code is:
Would appreciate some help here.
Thanks
list_a = [25,15,40,40,10] list_b = [40,40,10] if all(i for i in list_b) in list_a: print('true') else: print('false')When run, the code returns False despite all of the elements in list_b being present in list_a.
Would appreciate some help here.
Thanks