Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Simplifying Fitness Tracker Logic | Mastering Python if Statements
Conditional Statements in Python
course content

Kursusindhold

Conditional Statements in Python

Conditional Statements in Python

1. Mastering Python if Statements
2. Mastering Python if-else Statements
3. Mastering Python if-elif-else Statements

book
Challenge: Simplifying Fitness Tracker Logic

Opgave

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

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 1. Kapitel 6
toggle bottom row

book
Challenge: Simplifying Fitness Tracker Logic

Opgave

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

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 1. Kapitel 6
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