Challenge - #38 - Introduction to Sets

 def average(array):

    # your code goes here
    lst = list(set(array))
    avg_height = sum(lst)/len(lst)
    return avg_height

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

Comments

Popular posts from this blog

Challenge - #48 - Incorrect Regex

Challenge - #28 - itertools.product()

Challenge - #39 - Symmetric Difference