Skip to main content

Posts

Showing posts with the label Sets

Introduction to Sets Hackerrank Solution Python

 Introduction to Sets Hackerrank Solution Python code:: def  average(array):      # your code goes here     s =  set ()      for  i  in  array:         s.add(i)      return   sum (s)/ len (s) if  __name__ ==  '__main__' :     n =  int ( input ())     arr =  list ( map ( int ,  input ().split()))     result = average(arr)      print (result)