We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- Introduction to Sets
- Discussions
Introduction to Sets
Introduction to Sets
Sort by
recency
|
609 Discussions
|
Please Login in order to post a comment
code
def average(array): return sum(set(array)) / len(set(array))
def average(array): high = set(array) divider = len(high) val = sum(high)/divider return round(val,3)
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)