Advertisement
Guest User

Untitled

a guest
May 26th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def main():
  2. N = input('N: ')
  3. i = 1
  4. Sx2 = 0.0
  5. Sx = 0.0
  6. Sy = 0.0
  7. Sxy = 0.0
  8. while (i <= N):
  9. print "digite X", i,
  10. x = float(input(':'))
  11. print "digite Y", i,
  12. y = float(input(':'))
  13. Sx2 = Sx2 + x**2
  14. Sx = Sx + x
  15. Sy = Sy + y
  16. Sxy = Sxy + x * y
  17. i += 1
  18. print "Sx2 : ", Sx2, "\nSx : ", Sx, "\nSy : ", Sy, "\nSxy : ", Sxy, "\nDelta : ", (N * Sx2 - Sx**2)
  19.  
  20.  
  21. if __name__ == '__main__':
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement