SHARE
TWEET

Untitled

HugoCzerniawski Feb 14th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sat Feb 15 01:07:48 2020
  4.  
  5. @author: Hugo
  6. """
  7.  
  8. import sys
  9. import math
  10.  
  11. ls = []
  12.  
  13.  
  14.  
  15.  
  16. n = int(input('enter the list size: '))
  17.    
  18. for i in range(0, n):
  19.     print('Enter the number at location',  i+1 ,':')
  20.     item = float(input())
  21.     ls.append(item)
  22.        
  23.        
  24. def main():
  25.     ls  = [float(number) for number in sys.stdin]
  26.     avg = sum(ls)/len(ls)
  27.     print("Avg =  %f" % avg)
  28.     for number in sorted(ls):
  29.         print("number = %f, odchylenie od sredniej = %f" %(number,math.fabs(avg-number)))
  30. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top