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…
Showing 1–10 of 15
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…
Quiz
…on Python data types: 15 questions on int, float, str, bool, None, lists, tuples, dictionaries and sets, with instant answers.
Example
…data types automatically. Learn int, float, str and bool.
Quiz
…and input(): 15 questions on int(), float(), str(), bool() and reading numbers from the user.
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.