Remove duplicate item in a list


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. a = [3, 3, 5, 7, 7, 5, 4, 2]
  2. a = list(set(a)) # [2, 3, 4, 5, 7]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.