# take list
      my_list = [1, 2, 3, 1, 5, 3, 4, 2, 7]
      # printing original list
      print('List:', my_list)
      # removed duplicates item using native method
      new_list = []
      for i in my_list:
          if i not in new_list:
              new_list.append(i)
      # print list after item deletion
      print('New list:', new_list)
      
      Python language logo

      Duplicate elimination

      list
      DSA
      beginner

      Python program to remove duplicates from list

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.