Challenge
Flag from config text
A config file says dry_run is False, yet bool("False") turns it into True and the engine simulates instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings…
8 results
Challenge
A config file says dry_run is False, yet bool("False") turns it into True and the engine simulates instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings…
Challenge
…for whole numbers, float for decimals, str for text and bool for True / False . Replace each ... with the type of that value, for example crew_type = int . You can check with print(type(crew)) , but…
Challenge
…10 minutes, using or, then name the rule that fired with boolean variables and an if/elif chain.
Challenge
…gives and store it in converted_type . Then find out what bool(valve_open) gives, True or False , and store it in bool_of_valve . Run them to check, then remove any lines you added before you check…
Challenge
…of the readings in reading_type : int , float , str or bool . Modify. The readings arrive as text, so leave the two lines that set them as they are. Convert them where you add them up, with int() , so…
Challenge
A crew count read with input() crashes when 1 is added to it. Predict the crash, find out what input() really returns, fix it with int(), then write a packing tool that reads two numbers.
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
…unknown setting True is also an int in Python, so rule out bool first: isinstance(value, bool) or not isinstance(value, (int, float)) . load_config() Move the work into load_config(text) , which…