thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

01.04 · Conditions and decisions / Practice · 6 min

Count exactly 50 as a pass

A learner reached the required score, but the program still says Fail. Check which comparison includes the boundary.

Activity 4 of 9 in Conditions and decisions

All courses

Python 2: Logic, Loops & Functions / 01.04

Practice the pass boundary

Not started

Fix a pass/fail condition so a score of exactly 50 follows the passing path.

More options

Your lesson progress

Walkthrough: not startedPractice: not started

Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Rob compares scores 49, 50 and 75, asking whether exactly 50 should count as passing.
Rob’s comic strip · Conditions and decisions

Your task: include the boundary

Keep score assigned to 50. The passing rule is 50 or above. Repair the condition so result receives the text Pass at that boundary. Keep the else branch assigning Fail for scores below 50 and keep the single print(result) call.

The checks inspect score, result and the printed message for the starting input. They do not prove that the condition handles every other score. After passing, try 49, 50 and 75 in the editor: expect Fail, Pass and Pass. Restore 50 before rerunning the fixed-input checks.

Build it one step at a time

Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.

The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.

Start mini-lesson(opens in a new tab)

3 steps · Saved work · Instant feedback

YOUR TURN

Include the passing score

Keep score = 50. Repair the if condition so 50 or above stores Pass in result; below 50 must store Fail. Keep the existing print(result) call and print only one message.

Expected output
Pass

Keep the starting inputs. Print these lines in this order, without extra output.

  • Keep the boundary score at 50
  • Store Pass in result for exactly 50

Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.

Ready to checkRun the checks to see your results here.

Need a nudge?

Include equality

The rule says 50 or above. Compare greater than with greater than or equal to; which includes exactly 50?

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

Ready to try it?

Practice in your browser and see your results.

Progress details

Have a question?

Ask the Code Zone community.

Ask a question in The Code Zone (opens in a new tab)

Continue learning

ONE STEP FORWARD

A threshold includes equality only when its comparison says so. Next, give zero its own path.