Skip to content

Commit 2a22837

Browse files
Create Introduction to Sets.py
1 parent 25dc114 commit 2a22837

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def average(array):
2+
array_set= set(array)
3+
total_number=len(array_set)
4+
return "{:.3f}".format(sum(array_set)/total_number)
5+
6+
if __name__ == '__main__':
7+
n = int(input())
8+
arr = list(map(int, input().split()))
9+
result = average(arr)
10+
print(result)

0 commit comments

Comments
 (0)