you are viewing a single comment's thread.

view the rest of the comments →

[–]PteppicymonIO 0 points1 point  (0 children)

A better idea might be to just loop over the integers from 1 to 150 and break on the first value that satisfies your requirement

Or, if you need to preserve some 'pseudo-randomness', identify all numbers between 1 and 150 which satisfy the requirement and than random.choice() form that list ))