Here in my code I am getting output something like <generator object <genexpr> and I dont know why. I tried to cast it to some tuple or list but still the same problem.
for example:
>>> 5 1000 //where n = 5 is number of points, p = 1000 the money which already exists
>>> 386 780 0 //x,y,m and we just care about m here and if m of any point is bigger than p,
494 160 1215 //we append the point to the list l
313 573 1553
216 506 750
355 506 1630
output should be number of points '2 3 5' but I'm getting this:
<generator object <genexpr> at 0x012AB610> <generator object <genexpr> at 0x012AB5A0> <generator object <genexpr> at 0x012AB648>
My code:
import random
random.seed(42)
n, p = list(map(int, input().split()))
x = []
y = []
m = []
l = set()
for i in range(0, n):
a1, a2, a3 = list(map(int, input().split()))
x.append(a1)
y.append(a2)
m.append(a3)
points = [random.random() for _ in range(n)]
for v in m:
if v > p:
l.add(v(point) for point in points)
print(*l)
print(len(l))