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
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.
Your lesson progress
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.

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.
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.
Your check results
Need a nudge?
Include equality
The rule says 50 or above. Compare greater than with greater than or equal to; which includes exactly 50?
One possible solution
Your code may look different and still be correct. Compare the approach with your own.
At exactly 50, >= includes equality and chooses Pass. At 49 the condition is false, so else assigns Fail. Change the input to check both paths.
score = 50
if score >= 50:
result = "Pass"
else:
result = "Fail"
print(result)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

7 days freeTry The Code Zone
THE CODE ZONE COMMUNITY
Your next step is easier together.
Try the community free for 7 days.
No charge during your trial. Choose your plan on Skool.
- Ask questions and get support in the community
- Watch every course video walkthrough
- Find a study buddy in the 24/7 study room
Make the most of your trial with Premium.
Choose Premium on Skool to try Thursday live help sessions. Bring your questions, work through code, and get unstuck together.
Scheduled Thursdays in Eastern Time. Check the Skool calendar for your local date and time.
Have a website account? Sign in