Introduction to Sets

  • [deleted]Challenge Author
    + 0 comments

    For Python3

    def average(array):
        return sum(set(array))/len(set(array))
    
    if __name__ == '__main__':
        n = int(input())
        arr = list(map(int, input().split()))
        result = average(arr)
        print(result)