def points(x,y): with open('stats.txt','r') as f: dist = math.sqrt(x**2 + (y-300)**2) if dist <= 300: return 2 else: return 3