Q2.Program to find median of list of valuesimport statistics l=[1,2,3,4,5] print(statistics.mean(l)) output >>> ================== RESTART: C:/Users/Dell/Desktop/statis.py ================== 3
Q3.Program to find mode from list of valuesimport statistics l=[1,2,3,4,5] print(statistics.median(l)) output >>> ================== RESTART: C:/Users/Dell/Desktop/statis.py ================== 3
Q4.Program to find standard derivation from list of values.import statistics a=[1,2,3,4,5,5,4,4] print(statistics.mode(a)) output >>> ================== RESTART: C:/Users/Dell/Desktop/statis.py ================== 4
Q5 Program to find flatten list using nested for loopimport statistics a=[1,2,3,4,5,5,4,4] print(statistics.stdev(a)) output >>> ================== RESTART: C:/Users/Dell/Desktop/statis.py ================== 1.4142135623730951
l=[[1,2,3,4],[5,6,7,8]] result=[] for sublist in l: for element in sublist: result.append(element) print(result) output >>> ================== RESTART: C:/Users/Dell/Desktop/statis.py ================== [1, 2, 3, 4, 5, 6, 7, 8]
0 Comments