Write a Python Program to Calculate the Length of a Set || Functions || Sets || Python
In this we are going to see a basic program which finds the length, maximum and minimum element and calculates the sum and average of sets in Python Programming Language.


set1 = {1, 3, 6, 9, 2, 7, 2, 8, 4, 5}
print("Set1 : ", set1)

# For Finding Length Of Set
print("Length Of Set Is : ", len(set1))
# For Finding Maximum Element In Set
print("Maximum Element In Set Is : ", max(set1))
# For Finding Minimum Element In Set
print("Minimum Element In Set Is : ", min(set1))
# For Finding The Sum Of All Elements In Set
print("Sum Of All Elements In Set Is : ", sum(set1))
# For Finding The Average Of All Elements In Set
print("Average Of All Elements In Set Is : ", sum(set1)/len(set1))

# Coded By DHIRAJ SHELKE


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post