Challenge
Test the pipeline
…from "Telemetry pipeline" has been split into small functions, ready for the ground station to run unattended. Before it goes live, the team wants tests: whoever changes the pipeline next must find…
Showing 51–60 of 86
Challenge
…from "Telemetry pipeline" has been split into small functions, ready for the ground station to run unattended. Before it goes live, the team wants tests: whoever changes the pipeline next must find…
Example
Functions enumerate() and range() extend for loop capabilities in Python.
Example
Changing data types using int(), float() and str() functions. Converting between types.
Example
Operator * allows accepting any number of positional arguments.
Example
Parameters can have default values. Used when argument is not provided.
Challenge
…it stays fixed? Six months from now someone will tidy the function, and log=[] looks so much simpler than the None check. Write the test that proves the fix: it has to pass now and fail on the old…
Challenge
Write assert checks for parse_line() from "Parser 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…
Challenge
…with a ValueError . That refusal is part of what the function promises, as much as the arithmetic is, and like the arithmetic it can quietly break. Write the test that keeps it honest. The hidden…
Quiz
Free beginner quiz on Python for loops: 15 questions on lists, strings, range(), enumerate(), totals and break, with instant answers.
Example
Operator ** allows accepting any number of keyword arguments.