← Back to challenges

Random Integer Generator

PythonMediumfunctional_programmingnumbers

Instructions

The challenge is simple. Return a random integer N such that a <= N <= b.

Examples

random_int(5, 9) ➞ 7

random_int(5, 9) ➞ 9

random_int(5, 9) ➞ 5

Notes

  • Return value must be an integer.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Return Sole Element in a Set