Program to calculate Percentile of a student based on rank | Program to calculate the percentile ; flat variable to store the result ; calculate and return the percentile ; Driver Code
def getPercentile ( rank , students ) : NEW_LINE INDENT result = ( students - rank ) / students * 100 ; NEW_LINE return result ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT your_rank = 805 ; NEW_LINE total_students = 97481 ; NEW_LINE print ( getPercentile ( your_rank , total_students ) ) ; NEW_LINE DEDENT