Random number Check loop

I am trying to make a loop that gets a random number and checks it to see if that number is in a list if it is in the list then I want the loop to repeat to get a new number
Something like this:

This causes a stack overflow and I was wondering if there was something similar to this.

Nevermind I figured out a different way of doing what I wanted

Mark this as resolved then :slight_smile: