Kursinnhold
Conditional Statements in Python
Conditional Statements in Python
Challenge: Simplifying Fitness Tracker Logic
Oppgave
Swipe to start coding
You're building a fitness tracker app that provides motivational messages when users reach their fitness goals. Currently, the logic is cluttered with multiple if
statements, and it's your job to simplify it.
- Combine the two conditions into a single
if
statement. - Use the
or
operator to check if at least one of the conditions is met. - Ensure
result_message
is updated only once inside the if block.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6
Challenge: Simplifying Fitness Tracker Logic
Oppgave
Swipe to start coding
You're building a fitness tracker app that provides motivational messages when users reach their fitness goals. Currently, the logic is cluttered with multiple if
statements, and it's your job to simplify it.
- Combine the two conditions into a single
if
statement. - Use the
or
operator to check if at least one of the conditions is met. - Ensure
result_message
is updated only once inside the if block.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6