Example
Tuples vs Lists - Differences
When to use tuples instead of lists? Comparison of properties and applications.
Showing 41–50 of 55
Example
When to use tuples instead of lists? Comparison of properties and applications.
Example
Tuples are immutable lists. Once created, they cannot be modified.
Example
Python allows changing variable type during program execution. This is dynamic typing.
Challenge
…Instead of a board with one blank, the operators got an error and no board at all. Predict what happens, find out what the dict really holds, fix it, then build a board that copes with any missing…
Challenge
…line with one line per level: Entries: 7 INFO: 4 WARN: 3 ERROR: 0 Use the same pattern for each: "] INFO" , "] WARN" and "] ERROR" . A level that never appears counts as 0.
Article Python Fundamentals
…required. Forgetting it is probably the most common syntax error in this whole topic. Everything indented under the def line is the body of the function. Python uses that indentation (four spaces is…
Challenge
…together: the CSV reader from "Telemetry from CSV", the error handling from "Survive bad lines", the limits from the alert checks and the JSON from "JSON out". The ground station's export arrives…
Challenge
…crashes can't be checked. After you run it and see the error, put a # in front of the print line, then check: you'll see your prediction next to what the original line did. Investigate and modify…
Challenge
…tools filter them by level, and alarms go off when an ERROR line appears. That only works if every line has exactly the same shape: [T+00:12:05] INFO Engines nominal The time since launch in square…
Quiz
…status = "ready" , which of these lines run without an error? What happens when this code runs? Given fuel = 75 , which of these conditions are True ? Printing a condition is a quick way to debug it…