Answers for "function to print all the unique values in an array in python"

11

python list with only unique values

my_list = list(set(my_list))
Posted by: Guest on May-05-2020
0

print all unique values in a dictionary

dict = {'511':'Vishnu','512':'Vishnu','513':'Ram','514':'Ram','515':'sita'}
list =[] # create empty list
for val in dict.values(): 
  if val in list: 
    continue 
  else:
    list.append(val)

print list
Posted by: Guest on July-30-2020

Code answers related to "function to print all the unique values in an array in python"

Python Answers by Framework

Browse Popular Code Answers by Language