How to check the rank of the person whose name is entered Take the answer :
Use a list of index() The method can , as follows :
math_ranks = [' Zhang San ',' Li Si ',' Wang Wu ',' Lin daiyu ',' Jia Xichun ',' Sister Jia Qiao ']student = input(" Please enter the student's name ")rk = math_ranks.index(student)+1print(rk)