final - return median ######ListEnd###### def...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
def aremove(): a = [1, 2, 3, 4, 4, 2,3,6,4,4,1] print(a) for b in range(a.count(4)): a.remove(4) return a def getRange(alist): return max(alist)-min(alist) def getMax(alist): lmax = alist[0] for b in range(len(alist)): if lmax < alist[b]: lmax = alist[b] return lmax def getMean(alist): acc = 0 for b in range(len(alist)): acc = acc + alist[b] average = acc/len(alist) return average def getMedian(alist): median = [] alist.sort() if len(alist)%2 ==1: median.append(alist[len(alist)//2]) return median else: median.append(alist[len(alist)//2]) median.append(alist[len(alist)//2 -1])
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return median ######ListEnd###### def getMode(alist): countDict = {} for b in range(len(alist)): countDict[alist[b]]= alist.count(alist[b]) countDictv=countDict.values() maxcount= max(countDictv) modeList = for z in countDict: if countDict[z]== maxcount: modeList.append(z) return modeList ####While Loop### def inputAverage(): count = 0 acc = 0 userInpute = input('input') while userInpute != 'q': count = count + 1 acc = acc + float(userInpute) userInpute=(input('input')) average = acc/count return average...
View Full Document

Page1 / 2

final - return median ######ListEnd###### def...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online