Jump in rank of a student after updating marks | Function to print the name of student who stood first after updation in rank ; Array of students ; Store the name of the student ; Update the marks of the student ; Store the current rank of the student ; Print the name and jump in rank ; Names of the students ; Marks of the students ; Updates that are to be done ; Number of students
def nameRank ( names , marks , updates , n ) : NEW_LINE INDENT x = [ [ 0 for j in range ( 3 ) ] for i in range ( n ) ] NEW_LINE for i in range ( n ) : NEW_LINE INDENT x [ i ] [ 0 ] = names [ i ] NEW_LINE x [ i ] [ 1 ] = marks [ i ] + updates [ i ] NEW_LINE x [ i ] [ 2 ] = i + 1 NEW_LINE DEDENT highest = x [ 0 ] NEW_LINE for j in range ( 1 , n ) : NEW_LINE INDENT if ( x [ j ] [ 1 ] >= highest [ 1 ] ) : NEW_LINE INDENT highest = x [ j ] NEW_LINE DEDENT DEDENT print ( " Name : ▁ " , highest [ 0 ] , " , ▁ Jump : ▁ " , abs ( highest [ 2 ] - 1 ) , sep = " " ) NEW_LINE DEDENT names = [ " sam " , " ram " , " geek " ] NEW_LINE marks = [ 80 , 79 , 75 ] NEW_LINE updates = [ 0 , 5 , - 9 ] NEW_LINE n = len ( marks ) NEW_LINE nameRank ( names , marks , updates , n ) NEW_LINE