Ad
Code
Diff
  • def f():
        a = [1,2,3,4,5]
        b = [4,5,6,7,8]
    
        
        
        return [x for x in a if x not in b]
    • def f():
    • a = [1,2,3,4,5]
    • b = [4,5,6,7,8]
    • c = []
    • for i in a:
    • if i not in b:
    • c.append(i)
    • return c
    • return [x for x in a if x not in b]