hdarwin

cstutoringcenter.com_Midpoint Sums

Jan 4th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def midpoint(input):
  2.     cor0 = input.split("|")[0].split(",")
  3.     cor1 = input.split("|")[1].split(",")
  4.     return ((float(cor0[0])+int(cor1[0]))/2), ((float(cor0[1])+int(cor1[1]))/2)
  5. sum = 0
  6. for x in open("plane22.txt", "r"):
  7.     sum += midpoint(x)[1]
  8. print sum
Advertisement
Add Comment
Please, Sign In to add comment