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, 2019 in Python by Waseem
• 4,540 points
885 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, 2019 by Mohammad
• 3,230 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, 2019 in Python by Nisa
• 1,090 points
5,241 views
0 votes
1 answer

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

You can get the ASCII value of ...READ MORE

answered Aug 23, 2020 in Python by Sajetha Selva
9,658 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, 2019 in Python by Neel
• 3,020 points
2,870 views
0 votes
2 answers
0 votes
1 answer
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,442 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP