Challenge: CSV Data Processing
Swipe to start coding
Write a function that takes a CSV-formatted string containing names and ages, and returns the average age as a float. The CSV string will have a header row with the columns "name" and "age", followed by rows of data. The function should extract the ages, calculate the average, and return the result as a float.
- Parse the
csv_stringto extract the age values from each row. - Compute the average of the extracted ages.
- Return the average as a float.
Oplossing
Bedankt voor je feedback!
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Awesome!
Completion rate improved to 6.67
Challenge: CSV Data Processing
Veeg om het menu te tonen
Swipe to start coding
Write a function that takes a CSV-formatted string containing names and ages, and returns the average age as a float. The CSV string will have a header row with the columns "name" and "age", followed by rows of data. The function should extract the ages, calculate the average, and return the result as a float.
- Parse the
csv_stringto extract the age values from each row. - Compute the average of the extracted ages.
- Return the average as a float.
Oplossing
Bedankt voor je feedback!
single