Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: CSV Data Processing | Working with Structured Data Formats
Working with Strings and Data Formats

bookChallenge: CSV Data Processing

Oppgave

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_string to extract the age values from each row.
  • Compute the average of the extracted ages.
  • Return the average as a float.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 4
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

Awesome!

Completion rate improved to 6.67

bookChallenge: CSV Data Processing

Sveip for å vise menyen

Oppgave

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_string to extract the age values from each row.
  • Compute the average of the extracted ages.
  • Return the average as a float.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 4
single

single

some-alt