create list of unique values from dictionary

Solutions on MaxInterview for create list of unique values from dictionary by the best coders in the world

showing results for - "create list of unique values from dictionary"
Jessa
02 Mar 2020
1dict = {'511':'Vishnu','512':'Vishnu','513':'Ram','514':'Ram','515':'sita'}
2list =[] # create empty list
3for val in dict.values(): 
4  if val in list: 
5    continue 
6  else:
7    list.append(val)
8
9print list
10