Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- N = input('N: ')
- i = 1
- Sx2 = 0.0
- Sx = 0.0
- Sy = 0.0
- Sxy = 0.0
- while (i <= N):
- print "digite X", i,
- x = float(input(':'))
- print "digite Y", i,
- y = float(input(':'))
- Sx2 = Sx2 + x**2
- Sx = Sx + x
- Sy = Sy + y
- Sxy = Sxy + x * y
- i += 1
- print "Sx2 : ", Sx2, "\nSx : ", Sx, "\nSy : ", Sy, "\nSxy : ", Sxy, "\nDelta : ", (N * Sx2 - Sx**2)
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement