Challenge
Status message crash
A status line crashes with a TypeError because it joins text and a number with +. Predict it, read the error, fix it with str(), then build a docking status line.
Showing 31–34 of 34
Challenge
A status line crashes with a TypeError because it joins text and a number with +. Predict it, read the error, fix it with str(), then build a docking status line.
Challenge
A sensor packet mixes text, numbers and text that only looks like numbers. Predict what type() shows, find the values that need converting, then convert a packet yourself.
Article Mini projects
…CREATE TABLE IF NOT EXISTS astronauts ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, age INTEGER, nationality TEXT ) ''') cursor.execute(''' CREATE TABLE IF NOT EXISTS medical_records ( id INTEGER…
Example
Tuple unpacking assigns its elements to separate variables simultaneously.