Question
Please note that the 3 apostrophes beside the first student name Jade and the last student score of 100 are required for the test case
Please note that the 3 apostrophes beside the first student name Jade and the last student score of 100 are required for the test case to pass.
Write a python function max_scores(grades) that takes in a gradebook of students and returns a stripped multiline string where each line is in the form student_name: max_score. A gradebook is a multiline string where each line contains the students name followed by their scores, separated by commas.
Hint #1: You may want to use .split() and .splitlines(). Hint #2: Remember that the scores are strings you need to convert them to integers first. Hint #3: Make sure to use the .strip() method at the end to get rid of trailing spaces.
Test
grades = '''Jade,50,64,82,14
Brenda,90,67,73,80
Chris,75,75,75,75
John,100,85,90,99'''
assert(max_scores(grades) == '''Jade: 82
Brenda: 90
Chris: 75
John: 100''')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started