不知道我理解的对不对
import random
data = []
def get_data():
while True:
for i in range(10):
data.append(str(random.randint(0, 1)))
data1 = int(''.join(data), 2)
if data1 <= 1000:
return data1
else:
data.clear()