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
|
642 Discussions
|
Please Login in order to post a comment
def average(array): # your code goes here distinct = set(array) average = round(sum(distinct)/len(distinct),3) return average
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)
def average(array): values_of_array = set(array) length_of_array = len(values_of_array) averages_of_array = sum(values_of_array)
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)
def average(array): arr2 = set(arr) average = sum(arr2)/len(arr2) average2 = f"{average:.3f}" return average2
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)