is there a way to use randomchoice in a list without a specific element?

You can create a new list and pick randomly in the new list

random.choice([element for clew_list in agents if !(isinstance(element, crime))])

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top