Python By Code
Wednesday, July 15, 2015
Program to remove duplicate elements from list
list=[1,2,3,4,5,1,2,3,4,5,99,99]
newlist=[]
j=0
def removeduplicate(list):
for item in list:
if item not in newlist:
newlist.append(item)
removeduplicate(list)
print newlist
1 comment:
Rohit Vyawahare
July 15, 2015 at 10:20 PM
print(set(list))
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
print(set(list))
ReplyDelete