我知道答案应该是我的坐标的大约 60% 在这个范围内,但我只得到大约 20%
import random
import pylab
import numpy
pylab.close("all") #all import statements
x = [(random.randint(0,100)) for i in range(3000)] #creating list of x coordinates
y = [(random.randint(0,100)) for j in range(3000)] #creating list of y coordinates
array=zip(x,y) #creating an array by combining the x and y coordinates
counter = 0
for i, j in array:
if 35**2 <= (i**2+j**2) <= 65**2:
counter+= 1
print counter
谁能告诉我我做错了什么?