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
|
632 Discussions
|
Please Login in order to post a comment
def average(array): # your code goes here k = set(array) result = sum(k)/ len(k) return result
if name == 'main': n = int(input()) arr = list(map(int, input().split())) result = average(arr) print(result)
I really liked how it explained the concept clearly and gave a practical problem to apply it. Gold365 login id
Here is HackerRank Introduction to sets in python solution - https://programmingoneonone.com/hackerrank-introduction-to-sets-solution-in-python.html