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.
Soluzione
Grazie per i tuoi commenti!
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Awesome!
Completion rate improved to 6.67
Challenge: CSV Data Processing
Scorri per mostrare il menu
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.
Soluzione
Grazie per i tuoi commenti!
single