Mode Distribution
Swipe to start coding
Complete a function that determines the musical mode of a track based on its mode value. The mode is represented as an integer, where a value of 1 indicates a major mode and a value of 0 indicates a minor mode.
Inputs:
mode
: An integer representing the mode of the track. It can be either:1
for major mode.0
for minor mode.
Steps:
-
Determine Mode: Check the value of the
mode
input. Ifmode
is1
, the track is in a major mode, otherwise it is in a minor mode. -
Return the Mode:
- Return the string
'major'
if it is major mode. - Return the string
'minor'
if it is minor mode.
- Return the string
Løsning
Takk for tilbakemeldingene dine!
solution.py
main.py
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Oppsummer dette kapittelet
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 5.56
Mode Distribution
Sveip for å vise menyen
Swipe to start coding
Complete a function that determines the musical mode of a track based on its mode value. The mode is represented as an integer, where a value of 1 indicates a major mode and a value of 0 indicates a minor mode.
Inputs:
mode
: An integer representing the mode of the track. It can be either:1
for major mode.0
for minor mode.
Steps:
-
Determine Mode: Check the value of the
mode
input. Ifmode
is1
, the track is in a major mode, otherwise it is in a minor mode. -
Return the Mode:
- Return the string
'major'
if it is major mode. - Return the string
'minor'
if it is minor mode.
- Return the string
Løsning
Takk for tilbakemeldingene dine!
Awesome!
Completion rate improved to 5.56solution.py
main.py