Did they pass the class?
- O(1) · Trivial
- Free
- Python
- JavaScript
- booleans
- conditionals
Problem
You pass this class if you scored 60 points or more and you skipped no more than 5 classes. Both have to be true at once: 90 points with 8 skipped classes doesn't pass.
Return true if score and skipped are enough to pass, false if they aren't. Both limits count in your favor: exactly 60 and exactly 5 pass.
Examples
75, 2 → true
Short on points
58, 0 → false
Skipped too much
90, 8 → false
Besides these, the challenge has hidden tests that are revealed when you submit your solution.
You start with this
Python
def passed(score, skipped):
passJavaScript
function passed(score, skipped) {
}Solve this challenge
It opens in your browser, with the editor and the tests. It is free and you do not need an account to start.
More O(1) challenges
- Digits the other way rounddigits · operations
- Do the two times overlap?conditionals · booleans · comparisons
- Does it fall in range?conditionals · booleans · comparisons
- Does the photo fit the envelope?lists · conditionals · booleans
- How far apartoperations · comparisons
- How far from free shippingoperations · conditionals