Sort by

recency

|

3770 Discussions

|

  • + 0 comments

    print(format(functools.reduce(lambda x,y: x+y,student_marks[query_name])/len(student_marks[query_name]),".2f"))

  • + 0 comments

    I had some problems. I wrote the code, the program works but the page rejects it. I only found the error after an hour XD. I had written 'print' between the lines so that I could observe during the writing of the function whether everything was happening as it should XDDD

    query_name = input()
    
    query_name_score = student_marks.get(query_name)
    avarge = sum(query_name_score)/len(query_name_score)
    print(f'{avarge:.2f}')
    
  • + 0 comments

    if name == 'main': n = int(input()) student_marks = {} for _ in range(n): name, *line = input().split() scores = list(map(float, line)) student_marks[name] = scores query_name = input() if query_name in student_marks: Avg = student_marks.get(query_name) Sum= sum(Avg) vg=((float(Sum)) / float(3)) print("{:.2f}".format(vg))

  • + 0 comments
    if __name__ == '__main__':
        n = int(input())
        student_marks = {}
        total = 0 
        for _ in range(n):
            name, *line = input().split()
            scores = list(map(float, line))
            student_marks[name] = scores
        query_name = input()
    
        scorelist = student_marks[query_name]
        
        for i in scorelist:
            total += i
        
        average = total/len(scorelist)
        print("{:.2f}".format(average))
    
  • + 0 comments
    marks = student_marks[query_name]
    mean_marks = sum(marks) / len(marks)
    print(f'{mean_marks:.2f}')