Quiz
Python Sets Quiz
…and comparing sets . After this one, try the Python Tuples Quiz or the Python Dictionaries Quiz .
Showing 21–28 of 28
Quiz
…and comparing sets . After this one, try the Python Tuples Quiz or the Python Dictionaries Quiz .
Quiz
…Conditions: if , elif , else and truthy values Lists, tuples, dictionaries and sets Loops with range() , break and continue Functions: default values, keyword arguments, returning several values and…
Article Python Fundamentals
…= [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"…
Example
For loop iterates through sequence elements. Basic iteration over lists.
Example
Sets store only unique elements without a specific order.
Challenge
…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…
Challenge
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…
Article Python Fundamentals
…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…