How would I go about generating a random integer in python that is random but falls into a multiplication table (times table) range per se and is determined by a value I specify?
Example. Say i want to generate a random number between 10 and 100 but it should be a multiple of 7. Possible return values could be 14, 28, 49, 77 etc.
A mockup of the function could look like this:
def gen_random(f, min, max):
#generate random number between min and max that is a multiple of fac
Is Python’s random module capable of doing this?
Why not just generate a multiplier of
facthat gives you a number between your bounds?