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

bookChallenge: CSV Data Processing

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 4
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 6.67

bookChallenge: CSV Data Processing

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 4
single

single

some-alt