Results for “tuples”

Showing 21–28 of 28

  1. Article Python Fundamentals

    Variables and data types in Python

    …= [167, 464, 15, -63] # Average temperatures in Celsius Tuples Immutable sequences, useful for storing fixed data: earth_coordinates = (0, 0, 0) # x, y, z coordinates mission_details = ("Apollo 11"…

  2. Example

    Creating Sets

    Sets store only unique elements without a specific order.

    Audio lesson set unique
  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
  4. Challenge

    Print the manifest

    In "Manifest line" you printed one item from a tuple. The logistics system now exports the whole manifest as a list of dicts, one per item, with an ID, a name, a category and a mass. The loading crew…

    Write the code Easy 2 stages dictionaries lists of dicts for loop formatting
  5. Article Python Fundamentals

    Python Functions for Beginners

    …return seconds, minutes , Python packs both values into a tuple , a small fixed bundle of values. If you printed the whole result, you'd see (750.5203607834766, 12.50867267972461) . The line sec, mins…