Results for “nested conditions”

2 results

  1. Challenge

    Flatten nested ifs

    Refactor a docking check built from three nested ifs into one condition joined with and, keeping the output exactly the same, then rewrite it as a flat if/elif chain that reports the first check that…

    Fix the code Medium 2 stages if elif and nested conditions
  2. Challenge

    Guard clauses

    Rewrite the four nested ifs in can_dock() as guard clauses that return a reason as soon as a check fails, keeping every answer the same, then add a new docking rule as one more guard with a default…

    Fix the code Medium 2 stages functions return guard clauses refactoring