Code:
def make_cities(self): cities = [] for i in range(0,n): too_close = True while too_close ==True: x , y = random.randint(10,990),random.randint(10,490) too_close = False for city in cities: if city[0] in range(x-30,x+30) and city[1] in range(y-30,y+30):
Leave a comment: