pyPython Practice LabFrom first print to final round
TOPIC 03 OF 18

Decisions with Conditions Python lessons

if, elif, else, truth values, validation, and choosing between outcomes.

10 exercises8+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL LEARN

Core concepts

Classify even or oddClassify a number's signFind the larger of two valuesFind the largest of three valuesDetect a leap yearConvert a score to a gradeSet an age-based ticket priceValidate and classify a triangle
REUSABLE THINKING

Problem-solving patterns

  • if · modulo
  • comparison · elif
  • comparison · branches
  • max · list
  • boolean logic · calendar
LESSON OUTCOME

What this topic builds

Learn the idea once, trace it through two verified cases, then explain why your approach works.

ORDERED LESSONS

All 10 lessons in this topic

Work from top to bottom to build each concept gradually.

  1. #011
    Classify even or odd

    Classify a locker number into the even or odd row.

    StarterPremium
  2. #012
    Classify a number's sign

    Classify a positive daily profit value.

    StarterPremium
  3. #013
    Find the larger of two values

    Choose the larger of two supplier bids for a comparison report.

    BeginnerPremium
  4. #014
    Find the largest of three values

    Find the highest score among three finalists.

    BeginnerPremium
  5. #015
    Detect a leap year

    Determine whether a scheduling year includes February 29.

    BeginnerPremium
  6. #016
    Convert a score to a grade

    Convert a valid assessment score to its letter grade.

    BeginnerPremium
  7. #017
    Set an age-based ticket price

    Quote the museum price for a school-age visitor.

    IntermediatePremium
  8. #018
    Validate and classify a triangle

    Classify a triangular frame with three equal sides.

    IntermediatePremium
  9. #019
    Check a basic password policy

    Validate a signup password that mixes letters and digits.

    IntermediatePremium
  10. #020
    Calculate a shipping fee

    Determine shipping for a guest whose order reaches the free-shipping threshold.

    AdvancedPremium