Challenge
sort() returns None
crew = crew.sort() leaves the roster as None. Predict it, find out what sort() really gives back, fix it by sorting in place, then sort readings from highest to lowest and keep the top three.
Showing 1–10 of 43
Challenge
crew = crew.sort() leaves the roster as None. Predict it, find out what sort() really gives back, fix it by sorting in place, then sort readings from highest to lowest and keep the top three.
Challenge
…function": the whole record for a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't pass.
Challenge
…first, then the edge cases, an empty list that should give None and lists with negative values, so broken copies of the function can't pass.
Challenge
…check from "Alert level" so a sensor that didn't answer, None, prints NO DATA instead of crashing, without treating a real 0 as missing, then do the same for an empty field in a telemetry line.
Challenge
…Predict it, prove the calls share one list, fix it with None as the default, then write a function that hands out a fresh list each time.
Challenge
…which returns the record dict, then let it return None for blank, comment and damaged lines so the loop only keeps real records.
Challenge
…a keyword-only decimals option after *values and return None when there are no values.
Quiz
…quiz on Python return values: 15 questions on return, None, several values, lists, dictionaries and early exit. Instant answers.
Challenge
…its result instead of returning it, so the caller gets None. Predict the last line, find out what the function gives back, fix it with return, then write a conversion function that returns.
Challenge
status_light() returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function…