Results for “bool”

Showing 1–10 of 15

  1. 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…

    Fix the code Easy 3 stages bool if else config
  2. Challenge

    Mission config

    …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…

    Write the code Easy 3 stages variables data types int float
  3. Challenge

    Safe mode

    …10 minutes, using or, then name the rule that fired with boolean variables and an if/elif chain.

    Write the code Medium 2 stages if elif or and
  4. Challenge

    What arrived?

    …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…

    Write the code Easy 3 stages type() data types type conversion sensor data
  5. Challenge

    Readings that won't add

    …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…

    Fix the code Easy 3 stages type conversion int float str
  6. Challenge

    input() returns text

    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.

    Fix the code Easy 3 stages input int TypeError type conversion