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
|
626 Discussions
|
Please Login in order to post a comment
import statistics
def average(array): return statistics.mean(set(array))
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)
def average(array): avg=sum(set(arr))/len(set(arr)) return avg
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)