Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Count Explicit Tracks | Section 3
Python - Music

Stryg for at vise menuen

book
Count Explicit Tracks

Opgave

Swipe to start coding

Complete a function that counts the number of tracks marked as explicit from a list of tracks. Each track is represented as a dictionary containing various fields, including an explicit field that indicates whether the track is explicit.

Inputs:

  • tracks: A list of dictionaries, where each dictionary represents a track and contains at least the following field:
    • explicit: A boolean indicating whether the track is explicit.

Steps:

  • Iterate Through Tracks:
    • Loop through each track in the tracks list.
    • For each track, check the value of the explicit field.
    • If the explicit field is True, increment explicit_count by 1.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
py

solution.py

py

main.py

Vi beklager, at noget gik galt. Hvad skete der?

Spørg AI

expand
ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

book
Count Explicit Tracks

Opgave

Swipe to start coding

Complete a function that counts the number of tracks marked as explicit from a list of tracks. Each track is represented as a dictionary containing various fields, including an explicit field that indicates whether the track is explicit.

Inputs:

  • tracks: A list of dictionaries, where each dictionary represents a track and contains at least the following field:
    • explicit: A boolean indicating whether the track is explicit.

Steps:

  • Iterate Through Tracks:
    • Loop through each track in the tracks list.
    • For each track, check the value of the explicit field.
    • If the explicit field is True, increment explicit_count by 1.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 2
Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Vi beklager, at noget gik galt. Hvad skete der?
some-alt