r/learnpython•
musicomet

Elegant way to choose a random integer that isn't == n?

Consider this example:

n = 4

I need to generate a random number each time but it can never equal to n. Of course, n is a variable and it's not always == 4.

Posted Jul 31, 2015, 11:31 PM UTC

838
Loading comments…