Results for “tuple unpacking”

7 results

  1. Challenge

    Manifest line

    Unpack an (id, item, mass_kg) tuple into three named variables and print a cargo manifest line, then fix the ValueError when the manifest adds a fourth field.

    Write the code Easy 2 stages tuples unpacking ValueError formatting
  2. Challenge

    Landing site

    Store the Perseverance landing site as a (lat, lon) tuple, unpack it into two variables in one line and print both to four decimals, then show it the way maps do, with N, S, E and W.

    Write the code Easy 2 stages tuples unpacking formatting coordinates
  3. Challenge

    Any number of values

    …The whole pass: 419.5 Inside the function, values is a tuple, so sum() and len() work on it. In the second call, average(*readings) passes the five readings as five separate arguments. An option after…

    Write the code Easy 2 stages functions *args unpacking keyword-only arguments