Sort by

recency

|

4640 Discussions

|

  • + 0 comments

    This is a well-structured problem that effectively tests list manipulation, sorting, and handling multiple conditions in Python. Ekbet48 login

  • + 0 comments

    if name == 'main': l = [] for _ in range(int(input())): name = input() score = float(input()) l.append([name, score])

    x = sorted(list(set([a[1] for a in l])))[1]
    
    print(*sorted([b[0] for b in l if b[1] == x]),sep="\n")
    
  • + 0 comments
    if __name__ == '__main__':
        names = []
        scores = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            #List of names
            names.append(name)
            #List of scores
            scores.append(score)
        # Save the second lowest score
        nd_low = sorted(list(set(scores)))[1]
        # The names and scores are in the same position in list, so...
        # Get the name that is in the same position of the second lowest score
        # and sort it
        result = sorted([
            name 
            for i, name in enumerate(names)
            if scores[i] == nd_low])
        # Print the result
        print(*result, sep="\n")
    
  • + 0 comments

    Help me, Please My code passes the sample Testcases but fails to pass the hidden test cases. can anyone help me by explaining where my logic is wrong!?

    if __name__ == '__main__':
        student = []
        for _ in range(int(input())):
            name = input()
            score = float(input())
            student.append([name,score])
    lowstudent =[]
    low = 100
    """uplow is second lowest marks"""
    uplow = 100
    for s in student:
        if s[1] < low:
            uplow=low
            low = s[1]
    for s in student:
        if s[1]==uplow:
            lowstudent.append(s[0])
    lowstudent.sort()
    for s in lowstudent:
        print(s)
    
  • + 0 comments

    Once you start coding in Python, it’s hard to go back. Clean syntax, huge community, and endless libraries! ekbet11 registration