Example
For Loop with enumerate and range
Functions enumerate() and range() extend for loop capabilities in Python.
Showing 21–30 of 56
Example
Functions enumerate() and range() extend for loop capabilities in Python.
Example
Sets store only unique elements without a specific order.
Example
Looping through keys, values or key-value pairs of a dictionary.
Challenge
From today's passes over four ground stations, collect every contact window longer than 8 minutes into one list, sorted by time, then find the longest stretch with no station in contact, counting…
Challenge
A Python program stops with a traceback. Read it from the bottom up to find the error, the function and the line, fix the bug there, then follow a longer traceback through four calls to a second bug.
Challenge
Count the mission log's entries per level, INFO, WARN and ERROR, in a dict of counters, then count any level at all with get() when DEBUG lines turn up, and print the levels in alphabetical order.
Example
Combining regular parameters, *args and **kwargs in one function.
Example
Operator ** allows accepting any number of keyword arguments.
Example
Dictionaries can contain other dictionaries. Useful for complex data structures.
Example
Parameters sep and end let you control separator and line ending in print function.