← Back to Lists
Question 142
Largest With Its Position
Largest With Its Position
The third element of grades is read from input() as one integer with no prompt. Using a for loop, find the largest grade and the index where it first appears, keeping a counter variable that you increase by one on every pass so you always know the current index; then print Largest <value> at index <index>. When two elements tie, the earlier index wins, so compare with a strict greater-than. Input: one integer. Do not use max() or any list method.
Expected Output:
Largest 91 at index 2= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Lists
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.