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
|
3865 Discussions
|
Please Login in order to post a comment
Just wanted to say that it would be useful to clarify in the problem description that the float should be converted to a string for the correct answer. Took a while for me to realize that round() would not work.
i=int(input()) marks={} for _ in range(i): name,*line=input().split() scores=list(map(float,line)) marks[name]=scores key=input() if key in marks: result=sum(marks[key])/len(marks[key]) print(f"{result:.2f}") else: print("not found that key")