Introduction to Sets

Sort by

recency

|

609 Discussions

|

  • + 0 comments

    code

    def average(array): return sum(set(array)) / len(set(array))

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

    def average(array): high = set(array) divider = len(high) val = sum(high)/divider return round(val,3)

  • + 0 comments
    def average(array):
        # your code goes here
        x = set(arr)
        return f'{(sum(x) / len(x)):.3f}'
    
  • + 0 comments

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

    if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)