Find your next starting point.
Try four fresh tasks: functions, records, expected failures and useful tests. Allow about 32 minutes; pause and return whenever needed. No installation or tutor login is required.
New to Python? Start Day 1. Already comfortable? Try these tasks before Studio setup. This is a diagnostic, not certification, a course-completion mark or a navigation lock.
Your readiness workspace
Runs in this browser · Python loads only on Run
Write an attempt before opening hints. Checks use changed inputs; an output replay is not enough. Read the failure, revisit the linked concept and retry. The worker is not a hostile-code security sandbox: only run code you trust. Runtime/network/checker failure is not evidence of a wrong answer.
JavaScript loads task controls. Python starts only after Run.
Reset replaces the selected draft. Copy unsaved text and use Backup & records before clearing storage or changing devices. Login does not sync learning records. Tutor review prepares a local question; review it and choose Send yourself.
Output
Errors and check feedback
Review concepts, not just a score
Each task below retains its own status. Saved checks are device-only records, not authenticated authorship. Opening course hints or solutions records guidance here when JavaScript and storage are available; the software cannot detect outside help. Without JavaScript, record help in your notes. Close the help, change the inputs and rebuild before judging your independence; Reset keeps guidance history.
No readiness results are claimed before checks load or run. Refreshers and Studio setup remain open.
Write and call a new function
Write reading_minutes(pages, rate): return pages divided by pages-per-minute. Inputs here are nonnegative integer pages and a positive numeric rate. Do not print inside the function or return a fixed sample. Keep the sample call, predict its result, then try zero pages and a different rate. Explain the difference between return and print.
Not checked here yet.
Refresh: Function parameters and return values.
Explain: Name the two inputs and predict one call before running. A function that only prints returns None.
Read the unfinished starter
def reading_minutes(pages, rate):
# Return the duration from both supplied inputs.
return None
print(reading_minutes(18, 6))
Hint 1 · guided assistance
Which value represents an amount, and which represents the rate?
Hint 2 · guided assistance
Division computes time from amount and amount-per-minute. return hands the result to the caller.
Hint 3 · guided assistance
For 12 pages at 4 pages per minute, reason about 12 / 4 before editing the function.
Hint 4 · worked solution and reasoning
Reveal after your own attempt. This is guided practice, not a pass; your draft stays unchanged.
def reading_minutes(pages, rate):
return pages / rateTrace: Name the two inputs and predict one call before running. A function that only prints returns None.
Close this solution, rebuild from the brief, then predict and try fresh inputs. Record outside help in your notes; a later check does not prove independence.
Filter a fresh collection
Write review_ids(rows). Each supplied row is a dictionary with a nonempty string id and a nonnegative integer minutes. Return a new list of IDs whose minutes are at least 10, in source order, keeping duplicate matching IDs. Do not change the rows. Empty input returns []. This is a declared selection rule, not an assessment of quality.
Not checked here yet.
Refresh: Loops · Conditions · Dictionary fields.
Explain: Trace 9 and 10, explain why order and duplicates remain, then try an empty collection.
Read the unfinished starter
def review_ids(rows):
# Select matching IDs without changing the records.
return []
rows = [{"id": "A", "minutes": 9}, {"id": "B", "minutes": 10}]
print(review_ids(rows))
Hint 1 · guided assistance
Does a value of exactly 10 belong in your result? What should empty input produce?
Hint 2 · guided assistance
Visit each record, inspect its minutes field, then append only its id when the rule matches.
Hint 3 · guided assistance
A list comprehension can combine the loop and condition, but an ordinary loop with append is equally valid.
Hint 4 · worked solution and reasoning
Reveal after your own attempt. This is guided practice, not a pass; your draft stays unchanged.
def review_ids(rows):
return [r["id"] for r in rows if r["minutes"] >= 10]Trace: Trace 9 and 10, explain why order and duplicates remain, then try an empty collection.
Close this solution, rebuild from the brief, then predict and try fresh inputs. Record outside help in your notes; a later check does not prove independence.
Handle one malformed value honestly
Write parse_count(text). Require a string; other caller types raise TypeError. Convert integer text with int, accepting surrounding whitespace. Return a nonnegative integer, or None for malformed text or a negative integer. Catch only the conversion ValueError. None means a refused value, not a measured zero. Do not hide every exception.
Not checked here yet.
Refresh: Parsing values · Expected exceptions.
Explain: Explain the different outcomes of "0", "seven" and a numeric caller. A refusal is not a successful measurement.
Read the unfinished starter
def parse_count(text):
# Validate the caller, then handle expected conversion failure.
return None
print(parse_count(" 7 "))
print(parse_count("seven"))
Hint 1 · guided assistance
Which caller error is different from an expected bad string? Why must zero remain valid?
Hint 2 · guided assistance
Check isinstance(text, str) before int. A try/except ValueError can handle malformed integer text.
Hint 3 · guided assistance
After conversion, a negative value is refused; returning None is different from returning 0 for every failure.
Hint 4 · worked solution and reasoning
Reveal after your own attempt. This is guided practice, not a pass; your draft stays unchanged.
def parse_count(text):
if not isinstance(text,str): raise TypeError("text required")
try:
value=int(text)
except ValueError:
return None
return value if value >= 0 else NoneTrace: Explain the different outcomes of "0", "seven" and a numeric caller. A refusal is not a successful measurement.
Close this solution, rebuild from the brief, then predict and try fresh inputs. Record outside help in your notes; a later check does not prove independence.
Repair a rule and write a useful check
Repair valid_rating(value): return a real boolean accepting only non-boolean integers 1 through 5. Then write test_rating(candidate), which calls a supplied function and raises AssertionError for a broken lower boundary, a broken upper boundary or boolean acceptance. It must accept a correct candidate. Test both boundaries and True. Use assert in this test, not to enforce a production input boundary. Keep the final test call.
Not checked here yet.
Refresh: Booleans · Meaningful assertions.
Explain: Name the original bug. Explain why a success print or a test that always raises cannot establish the rule.
Read the unfinished starter
def valid_rating(value):
return isinstance(value, int) and 0 <= value <= 5
def test_rating(candidate):
# Replace this print with real assertions using candidate.
print("not yet a test")
test_rating(valid_rating)
Hint 1 · guided assistance
True is an int subclass. Which lower and upper values distinguish the broken rules from the correct one?
Hint 2 · guided assistance
A success print checks nothing. Call candidate inside assert statements for accepted and refused inputs.
Hint 3 · guided assistance
Check candidate(1), candidate(5), candidate(0), candidate(6) and candidate(True) with is True/is False.
Hint 4 · worked solution and reasoning
Reveal after your own attempt. This is guided practice, not a pass; your draft stays unchanged.
def valid_rating(value):
return type(value) is int and 1 <= value <= 5
def test_rating(candidate):
assert candidate(1) is True
assert candidate(5) is True
assert candidate(0) is False
assert candidate(6) is False
assert candidate(True) is FalseTrace: Name the original bug. Explain why a success print or a test that always raises cannot establish the rule.
Close this solution, rebuild from the brief, then predict and try fresh inputs. Record outside help in your notes; a later check does not prove independence.
Choose your next step
If writing the function or following the loop is still confusing, begin with the linked Lab lesson and revisit its independent task. If these checks pass and you can explain new inputs without copying, start Studio setup and attempt Build 1 challenge-first. Keep its project deliverable; do not skip portfolio work based on this diagnostic.
Continue to Studio setupChoose a Lab refresherKeep your final audit code/report separately. No readiness result automatically approves a portfolio, service deployment, paid API use or learner competence.