We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Finding the percentage
Finding the percentage
Sort by
recency
|
3928 Discussions
|
Please Login in order to post a comment
stud_scores = student_marks[query_name] total=0 for score in stud_scores: total = total+score avg = total/len(stud_scores) print(f"{avg:.2f}")
n = int(input()) student_marks = {} for _ in range(n): data = input().split() name = data[0] scores = list(map(float, data[1:])) student_marks[name] = scores query_name = input() average_marks = sum(student_marks[query_name]) / len(student_marks[query_name])
print(f"{average_marks:.2f}")
For Python3 Platform
d={'Krisha':[67,68,69],'Arjun':[70,98,63],'Malika':[52,56,60]} name='Malika' sum=0 for i in range(len(d[name])): sum+=d[name][i] print(float(sum//len(d[name])))