-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
  • 5,814
  • 2
  • 12
  • 31
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.
  • 34,859
  • 4
  • 30
  • 47