Browse Source

Create Generate Range of Integers.md

PythonCoder8 3 years ago
parent
commit
37721cfbbb
1 changed files with 19 additions and 0 deletions
  1. 19 0
      8 kyu/Generate Range of Integers/Generate Range of Integers.md

+ 19 - 0
8 kyu/Generate Range of Integers/Generate Range of Integers.md

@@ -0,0 +1,19 @@
+8 kyu - Generate Range of Integers - Authored by XxxX88
+
+Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, with the step. The first integer is the minimum value, the second is the maximum of the range and the third is the step. (min < max)
+
+**Task**
+
+Implement a function named
+
+`generate_range(2, 10, 2) # should return list of [2,4,6,8,10]
+generate_range(1, 10, 3) # should return list of [1,4,7,10]`
+
+`generate_range(2, 10, 2) # should return array of [2, 4, 6, 8, 10]
+generate_range(1, 10, 3) # should return array of [1, 4, 7, 10]`
+
+**Note**
+
+* min < max
+* step > 0
+* the range does not HAVE to include max (depending on the step)