Sort by

recency

|

4577 Discussions

|

  • + 0 comments
    if __name__ == '__main__':
        python_students =[]
        marks =[]
        for _ in range(int(input())):
            student_data = []
            name = input()
            student_data.append(name)
            score = float(input())
            marks.append(float(score))
            student_data.append(score)
            python_students.append(student_data)
    
        python_students.sort()
        second_lowest = sorted(set(marks))
        for elements in python_students:
            if(elements[1] == second_lowest[1]):
                print(elements[0])
    
  • + 0 comments
    if __name__ == '__main__':
        students={}
        for _ in range(int(input())):
            name = input()
            score = float(input())
            students[name]=score
    
        min_value = min(students.values())
        students = {k: v for k, v in students.items() if v>min_value}
        min_value = min(students.values())
        students_names = dict(filter(lambda item: item[1]==min_value,students.items()))
        students_names = sorted(students_names.keys())
        for st in students_names:
            print(st)
    
  • + 0 comments
    if __name__ == '__main__':
        lis=[]
        for _ in range(int(input())):
            name = input()
            score = float(input())
    
            lista = [name,score]
            lis.append(lista)
        
        lis.sort(key=lambda x: x[1],reverse=False)
        
        for i in range(0,len(lis)):
            if lis[i][1]<lis[i+1][1]:
                val = lis[i+1][1]
                break
        new_lis = []
        for i in range(0,len(lis)):
            if lis[i][1] == val:
                new_lis.append(lis[i])
        
        new_lis.sort(key=lambda x: x[0],reverse=False)
        
        for i in range(0,len(new_lis)):
            print(new_lis[i][0])
        
        
        
    
  • + 0 comments
    if __name__ == '__main__':
        records = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            records.append([name, score])
    		
    
        sorted_arr=sorted(records, key=(lambda records: (records[1],records[0])))
        max_val=sorted_arr[0][1]
    
    
        new_arr=[arr for arr in sorted_arr if arr[1]!= max_val]
    
        second_highest=min([ele[1] for ele in new_arr])
    
        for arr in new_arr:
            if arr[1]==second_highest:
                print(arr[0])
    
  • + 0 comments
    if __name__ == '__main__':
        records = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            records.append([name, score])
    
        # Step 2: Extract grades and find second lowest unique grade
        grades = sorted(set([score for name, score in records]))  # Get unique grades and sort them
        
        # Step 3: Get the second lowest grade
        second_lowest = grades[1]  # The second unique grade
        
        # Step 4: Collect names of students with the second lowest grade
        second_lowest_students = [name for name, score in records if score == second_lowest]
        
        # Step 5: Sort names alphabetically
        second_lowest_students.sort()
        
        # Step 6: Print the names of students with the second lowest grade
        for student in second_lowest_students:
            print(student)