Results for “text”

Showing 1–10 of 84

  1. Challenge

    Flag from config text

    …instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings typed by hand.

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

    input() returns text

    …out what crew + "1" gives when you type 4, and store it as text in text_sum . Run print(crew + "1") to check, and remove that line before you check. Modify. Fix the program with int() , so that for 4…

    Fix the code Easy 3 stages input int TypeError type conversion
  3. Challenge

    Real JSON

    …worked on a ready-made dict, but the API really sends JSON text. Turn it into a dict with json.loads(), see what false and null become, then handle a response cut off in transfer.

    Write the code Easy 2 stages json json.loads modules import
  4. Challenge

    JSON out

    Turn the day's mission summary dict into JSON text with json.dumps() and indent=2, see what True, False and None become, then keep the station's Polish letters readable and sort the keys so the files…

    Write the code Easy 2 stages json json.dumps modules import
  5. Challenge

    Readings that won't add

    …add up to 12080 instead of 200 because they arrived as text. Predict it, find out why and fix it with int(), then add decimal readings with float().

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

    Mission config

    …investigate and extend a mission config held in variables: text, whole numbers, decimals and True/False. A PRIMM challenge on Python data types.

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

    What arrived?

    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.

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