Check out example codes for "introduction to sets hackerrank solution". It will help you in understanding the concepts better.

Code Example 1

def average(array):
    # your code goes here
    return sum(set(array))/len(set(array))

Learn ReactJs, React Native from akashmittal.com