# take list
      a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
      b = [1, 3, 4, 7, 9]
      # print original list
      print('list1 =', a)
      print('list2 =', b)
      # subtraction of list
      sub = list(set(a) - set(b))
      # print subtraction value
      print('list1 - list2 =', sub)
      
      Python language logo

      List Subtraction

      List
      DSA
      beginner

      Python program for Subtraction Between Two Lists

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.