Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions Remove Dubplicates.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter the elements separated by commas\n",
"tr,tro,fdi,tr,4,567,4\n",
"['tr', 'tro', 'fdi', '4', '567']\n"
]
}
],
"source": [
"def removedublicates():\n",
" print(\"Enter the elements separated by commas\")\n",
" a=input() #takes a list as input\n",
" b=a.split(',')\n",
" c=[]\n",
" for i in b: #remove duplicates\n",
" if i not in c:\n",
" c.append(i)\n",
" print(c) #returns a new list\n",
"removedublicates()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}