# How to display the indexes of a list in a list that are positive values?

jospercomp shared this question 1 month ago
Answered

input={-9,-29,8,17,-192,-44,23,-60,65,32}

index={ 1, 2, 3, 4, 5, 6, 7, 8, 9,10}

output={3,4,7,9,10}

Best Answer If you want the sublist of index of positive input values then

`KeepIf(input(j) > 0, j, index)`

You can get ALL indices of positive input values even without using index:

`KeepIf(input(j) > 0, j, Sequence(Length(input)))`

or

`RemoveUndefined(Sequence(If(input(k) > 0, k), k, 1, Length(input)))`

## Comments (2) 2

If you want the sublist of index of positive input values then

`KeepIf(input(j) > 0, j, index)`

You can get ALL indices of positive input values even without using index:

`KeepIf(input(j) > 0, j, Sequence(Length(input)))`

or

`RemoveUndefined(Sequence(If(input(k) > 0, k), k, 1, Length(input)))` 1

It is get ALL indices of positive input values even without using index. Leave a Comment
• GeoGebra
• Help
• Partners
• Contact us
• Feedback & Questions
• This email address is being protected from spambots. You need JavaScript enabled to view it.
• +43 677 6137 2693
© 2021 International GeoGebra Institute