Image for post
Image for post

First off, we will need to make a list with all sorts of numbers and include duplicate numbers.

list = [1,2,3,4,5,6,7,8,9,10,11,10,9,8,7,6,5,4,3,2,1]

Next we will need to start writing our for loop statement, however, before we begin writing a for loop, we want to include two empty variables outside of the for loop. One will be our temporary numbers and the second a unique numbers list.

temp = set()
unique = []

Set() is a builtin method in Python which returns an unordered collection data type that is iterable, mutable and has no duplicate elements. …






About

Artin Sinani

A Data Scientist in a Big Data world.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store