Introduction to Sets

  • + 0 comments
    # The sum of the set of the array is divided by the length of the set of the array and then rounded to three decimal places.
    
    def average(array):
        avg = sum(set(array)) / len(set(array))
        return round(avg, 3)