Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Find the second lowest grade of any student(s) from the given names and grades of each student using lists

if __name__ == '__main__':
    single_list=[]
    nested_list=[]
    score_list=[]
    for _ in range(int(input())):
        name = input()
        score = float(input())
        score_list.append(score)
        nested_list.append([name,score])
    nested_list=sorted(nested_list)
    sorted_score=sorted(score_list)
    minNumber=sorted_score[0]
    for score in sorted_score:
        if score>minNumber:
            second_less=score
            break
    
    for single in nested_list:
        if single[1]==second_less:
            print(single[0])
          
     
     
        
Comment

PREVIOUS NEXT
Code Example
Python :: check if any values overlap in numpy array 
Python :: write custom query odoo 
Python :: run flask application in development mode stack overflow 
Python :: modify dict key name python 
Python :: python format only 1 decimal place 
Python :: sigmoid function numpy 
Python :: pip install ffmpeg 
Python :: link python3 to python3.7 
Python :: py check discord token 
Python :: python print error traceback 
Python :: pandas select percentile 
Python :: remove all files in a directory mac 
Python :: cv2 resize 
Python :: typage in python 
Python :: python sorted descending 
Python :: if none in column remove row 
Python :: scikit learn ridge classifier 
Python :: tkinter window title 
Python :: pandas columns add prefix 
Python :: replace nan in pandas 
Python :: binary to text python 
Python :: hoe maak je machten in python 
Python :: for idx, col_name in enumerate(X_train.columns): print("The coefficient for {} is {}".format(file_name, regression_model.coef_[0][idx])) 
Python :: python program for simple interest 
Python :: python youtube video downloader 
Python :: python init matrix 
Python :: par o inpar python 
Python :: `12` print () 
Python :: how to change python version on linux 
Python :: python print exception type and message 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =