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
|
3815 Discussions
|
Please Login in order to post a comment
Use "{:.2f}".format(number) instead of round(number) to make sure trailing zeros are also printed
It looks like the task involves reading a dictionary containing student names as keys and their respective marks as values. cricbet99 com
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() avg=sum(student_marks[query_name])/len(student_marks[name]) print(f"{avg:.2f}")
I'm printing the expected output using following code but the test does't pass
Edit: nvm, removing the spaces in print to
print( f'{total/3:.2f}')
fixed it. The input/expected output UI format doesn't display these spaces though