diff --git a/Remove Dubplicates.ipynb b/Remove Dubplicates.ipynb new file mode 100644 index 0000000..a0f70d7 --- /dev/null +++ b/Remove Dubplicates.ipynb @@ -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 +}