← Back to challenges

List From a Range of Numbers

PythonMediumarrayslanguage_fundamentalsnumbers

Instructions

Create a function that returns a list of all the integers between two given numbers start and end.

Examples

range_of_num(2, 4) ➞ [3]

range_of_num(5, 9) ➞ [6, 7, 8]

range_of_num(2, 11) ➞ [3, 4, 5, 6, 7, 8, 9, 10]

Notes

  • start will always be <= end.
  • start and end are NOT included in the final list.
  • If start == end, return an empty list.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Buggy Code (Part 5)