import math math.avg(1, 2, 3, 4, 1, 2, 3, 1, 1, 2, 2, 5, 6, 7, 3, 4, 9)
import math def remainingside(a, b): return math.sqrt(a * a + math.pow(b, 2)) print("My name is Maya!") a = input("Enter the length of one of the sides of the triangle: ") a = float(a) b = input("Enter the length of the other side of the triangle: ") b = float(b) # compute c c = remainingside(a, b) print("The length of the remaining side is", c) math.avg()
for element in Result: tmp = groups(element,l) for el in tmp: tamponG.append(el) for element in tamponG: name = listToString(element) if name not in Groups: Groups.append(name) Number.append(1) elif name in Groups: i = Groups.index(name) Number[i] += 1 else: raise Exception('Unexpexted Error') # for i in range(len(Groups)): print Groups[i],Number[i] print len(tamponG) print len(Groups) print '' print 'x: ' + str(x) print 'y: ' + str(y) print 'l: ' + str(l) print '' print 'Max: ' + str(max(Number)) print 'Average: ' + str(crystalMath.avg(Number)) print 'Median: ' + str(med(Number)) print 'Min: ' + str(min(Number))
def get_review(self, id, review, rating): self.__reviews.append([id, rating, review]) self.rating = math.avg(self.__review[:, 1])
def cal_average(u_list): return math.avg(u_list)