Results for “function”

Showing 41–50 of 86

  1. Challenge

    Test the parser

    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…

    Write the code Medium 2 stages testing assert parsing None
  2. Challenge

    Test the error

    …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…

    Write the code Medium 2 stages testing assert try except
  3. Article Mini projects

    Calculating Escape Velocity in Python

    …Instead of Regular Python? While Python's built-in math functions work fine for simple calculations, NumPy offers several advantages for scientific computing: More efficient for large-scale…

  4. Challenge

    Unit converter

    Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…

    Write the code Medium 2 stages project dictionaries tuples as keys functions