-1

I have an array say numbers = [4,4,9,2,3] and I want to to find the lowest value within a custom range.

Range of index 2, I want the lowest value from [4, 4, 9].

so far, I have:

min(range(numbers[2))
Paritosh Singh
  • 6,034
  • 2
  • 14
  • 33
Leo Medina
  • 21
  • 4

1 Answers1

0

You don't need to use range, arrays already support slicing through subscripts:

min(numbers[:3])
Alain T.
  • 40,517
  • 4
  • 31
  • 51