How to remove the duplicate values in a list?

0 votes
a = [10,20,30,40,10,20,30,40,30,40,50,60]

how to remove only the duplicate values from this?

Mar 20 in Python by Waseem
• 4,480 points
20 views

1 answer to this question.

0 votes
a = [10,20,30,40,10,20,30,40,30,40,50,60]
s = set(a)
c = list(s)

print(c)

this will remove the duplicate values from the list.

answered Mar 20 by Mohammad
• 3,060 points

Related Questions In Python

0 votes
1 answer

How to count the number of elements in a list?

To count the number of elements of ...READ MORE

answered May 27 in Python by Nisa
• 1,090 points
17 views
0 votes
0 answers

How to get the ASCII values of a character in python?

Is there a function for this task ...READ MORE

Jul 17 in Python by Waseem
• 4,480 points
23 views
0 votes
1 answer

How to find the greatest number in a list in Python?

1. By using max function -  highest = ...READ MORE

answered Aug 21 in Python by Neel
• 3,010 points
41 views
+4 votes
7 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 281 views
0 votes
1 answer