{
    "componentChunkName": "component---src-components-layout-mdx-layout-tsx",
    "path": "/language/beginner",
    "result": {"data":{"site":{"siteMetadata":{"title":"Toit documentation"}},"mdx":{"body":"const _excluded = [\"components\"];\n\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\n\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nconst _frontmatter = {};\n\nconst makeShortcode = name => function MDXDefaultShortcode(props) {\n  console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n  return mdx(\"div\", props);\n};\n\nconst Expandable = makeShortcode(\"Expandable\");\nconst layoutProps = {\n  _frontmatter\n};\nconst MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  let {\n    components\n  } = _ref,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", {\n    \"id\": \"beginner-tutorial\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h1\",\n    \"href\": \"#beginner-tutorial\",\n    \"aria-label\": \"beginner tutorial permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Beginner tutorial\"), mdx(\"p\", null, \"These lessons are for someone new to programming. You will write a temperature\\nreport using sample readings, so you need a computer but no sensor or ESP32.\\nIf you already program, start with \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"/language/toitversus\"\n  }, \"Toit for programmers\"), \".\"), mdx(\"p\", null, \"You should be comfortable creating a text file and opening a terminal. The\\nterminal is where you type the command that runs your program. We explain the\\nprogramming concepts as they appear.\"), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Lesson\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"What you will make\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"1. Your first program, on this page\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Report whether one temperature is warm.\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/language/beginner/lists-and-functions\"\n  }, \"2. Lists and functions\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Report several readings using one reusable operation.\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, mdx(\"a\", {\n    parentName: \"td\",\n    \"href\": \"/language/beginner/objects\"\n  }, \"3. Objects\")), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Keep a room's name and readings together. Continue here when you are ready.\")))), mdx(\"p\", null, \"Each example is a complete program. Replace the contents of your file rather\\nthan appending the example to the previous one. Run it after each change.\"), mdx(\"h2\", {\n    \"id\": \"1-run-your-first-program\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#1-run-your-first-program\",\n    \"aria-label\": \"1 run your first program permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"1. Run your first program\"), mdx(\"p\", null, \"Install the \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://github.com/toitlang/toit#readme\"\n  }, \"Toit SDK\"), \", which includes\\nthe tools to run Toit programs. Check the installation by typing \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"toit --help\"), \"\\nin a terminal. It should display instructions for the command.\\nIf you already have Jaguar installed, use \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"jag toit\"), \" instead of \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"toit\"), \" in these\\ncommands; you do not need to connect a device.\"), mdx(\"p\", null, \"In a text editor, create a file named \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"report.toit\"), \" containing these two lines:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  print \\\"Temperature report\\\"\\n\")), mdx(\"p\", null, \"The two spaces before \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print\"), \" matter. Use spaces, not the Tab key.\\nSave the file, open a terminal in the directory containing it, and type:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-sh\"\n  }, \"toit run report.toit\\n\")), mdx(\"p\", null, \"You should see:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"Temperature report\\n\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"main:\"), \" marks where the program starts. The indented line underneath it is an\\ninstruction: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print\"), \" displays the text between the double quotes. Text written\\nthis way is called a \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"string\"), \". The quotes are part of the program, but are not\\nprinted.\"), mdx(\"p\", null, \"Change \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Temperature report\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Kitchen report\"), \", save, and run the command\\nagain. The new message should appear. The program runs the saved version of\\nyour file, so remember to save before running.\"), mdx(Expandable, {\n    title: \"If the program does not run\",\n    mdxType: \"Expandable\"\n  }, mdx(\"p\", null, \"If the terminal cannot find \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"toit\"), \", revisit the SDK installation instructions.\\nIf it cannot find \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"report.toit\"), \", check that the terminal is open in the directory\\nwhere you saved the file. If Toit reports a problem in the program, start with\\nthe first reported line. Compare the spelling, quotes, colon, and indentation\\nwith the example.\")), mdx(\"h2\", {\n    \"id\": \"2-give-a-value-a-name\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#2-give-a-value-a-name\",\n    \"aria-label\": \"2 give a value a name permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"2. Give a value a name\"), mdx(\"p\", null, \"We want the report to include a temperature. We could print \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"21\"), \" directly, but\\nnaming it lets us use the same value in several places.\"), mdx(\"p\", null, \"A \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"variable\"), \" is a name for a value. \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature := 21\"), \" creates a variable named\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature\"), \" with the value \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"21\"), \". The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \":=\"), \" introduces that new name.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  temperature := 21\\n  print temperature\\n\")), mdx(\"p\", null, \"This prints \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"21\"), \". There are no quotes around \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature\"), \": we want its value,\\nnot the word \\u201Ctemperature\\u201D. Instructions run from top to bottom, so the variable\\nis created before \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print\"), \" uses it.\"), mdx(\"p\", null, \"Change \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"21\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"24\"), \", save, and run again. Then try \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print \\\"temperature\\\"\"), \" and\\ncompare the output. Put \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print temperature\"), \" back before continuing.\"), mdx(\"h2\", {\n    \"id\": \"3-change-the-value\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#3-change-the-value\",\n    \"aria-label\": \"3 change the value permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"3. Change the value\"), mdx(\"p\", null, \"Once a variable exists, use \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"=\"), \" to replace its value. Use \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \":=\"), \" only when\\nintroducing the name.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  temperature := 21\\n  print temperature\\n  temperature = 24\\n  print temperature\\n\")), mdx(\"p\", null, \"The output is:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"21\\n24\\n\")), mdx(\"p\", null, \"The first \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"print\"), \" uses the value at that point in the program. Changing the\\nvariable later does not change text that has already been printed.\"), mdx(\"p\", null, \"You can calculate a new value from the old one. Replace \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature = 24\"), \"\\nwith \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature = temperature + 3\"), \". Toit first adds three to the current\\nvalue, then stores the result. The output should stay the same.\"), mdx(\"p\", null, \"Try adding five instead. Predict the second line before running the program.\"), mdx(\"h2\", {\n    \"id\": \"4-put-the-value-in-a-message\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#4-put-the-value-in-a-message\",\n    \"aria-label\": \"4 put the value in a message permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"4. Put the value in a message\"), mdx(\"p\", null, \"To print a label and a value together, put \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"$temperature\"), \" inside a string.\\nToit replaces it with the variable's value. This is called \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"interpolation\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  temperature := 21\\n  print \\\"Temperature: $temperature C\\\"\\n\")), mdx(\"p\", null, \"This prints:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"Temperature: 21 C\\n\")), mdx(\"p\", null, \"Change the value to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"24\"), \". You only need to change the line that sets the\\ntemperature; the message uses that value automatically.\"), mdx(\"h2\", {\n    \"id\": \"5-decide-what-to-print\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#5-decide-what-to-print\",\n    \"aria-label\": \"5 decide what to print permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"5. Decide what to print\"), mdx(\"p\", null, \"Our program should say \\u201CWarm\\u201D when the temperature is at least 25 degrees.\\nOtherwise, it should say \\u201CComfortable\\u201D. The question \\u201Cis this temperature at\\nleast 25?\\u201D is written as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"temperature >= 25\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  temperature := 24\\n  print \\\"Temperature: $temperature C\\\"\\n  if temperature >= 25:\\n    print \\\"Warm\\\"\\n  else:\\n    print \\\"Comfortable\\\"\\n\")), mdx(\"p\", null, \"This prints:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-text\"\n  }, \"Temperature: 24 C\\nComfortable\\n\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"if\"), \" asks the question. When the answer is yes, the program runs the further\\nindented instruction below it. When the answer is no, it runs the instruction\\nbelow \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"else:\"), \" instead. Only one of the two messages is printed.\"), mdx(\"p\", null, \"The comparison is called a \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"condition\"), \". Its result is \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"true\"), \" for yes or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"false\"), \"\\nfor no. Those two values are called \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"booleans\"), \".\"), mdx(\"p\", null, \"Try temperatures of \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"25\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"30\"), \". Both should print \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Warm\"), \". Try \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"20\"), \", which\\nshould print \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Comfortable\"), \". You have now checked values below, at, and above\\nthe threshold.\"), mdx(\"h2\", {\n    \"id\": \"practice-before-continuing\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#practice-before-continuing\",\n    \"aria-label\": \"practice before continuing permalink\",\n    \"className\": \"table-of-contents-icon before\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  }))), \"Practice before continuing\"), mdx(\"p\", null, \"Change the report so that it describes a freezer: print \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Freezing\"), \" when the\\ntemperature is below zero, and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Not freezing\"), \" otherwise. Use \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"<\"), \" for \\u201Cless than\\u201D.\\nCheck the program with \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"-5\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"0\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"5\"), \".\"), mdx(Expandable, {\n    title: \"Solution: check for freezing temperatures\",\n    mdxType: \"Expandable\"\n  }, mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-toit\"\n  }, \"main:\\n  temperature := -5\\n  if temperature < 0:\\n    print \\\"Freezing\\\"\\n  else:\\n    print \\\"Not freezing\\\"\\n\")), mdx(\"p\", null, \"This prints \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Freezing\"), \". With \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"0\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"5\"), \", it prints \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"Not freezing\"), \".\")), mdx(\"p\", null, \"You have a complete program that stores a reading, includes it in a message,\\nand chooses a description. Continue with\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"/language/beginner/lists-and-functions\"\n  }, \"lists and functions\"), \" to report several\\nreadings without copying the same instructions for each one.\"));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#beginner-tutorial","title":"Beginner tutorial","items":[{"url":"#1-run-your-first-program","title":"1. Run your first program"},{"url":"#2-give-a-value-a-name","title":"2. Give a value a name"},{"url":"#3-change-the-value","title":"3. Change the value"},{"url":"#4-put-the-value-in-a-message","title":"4. Put the value in a message"},{"url":"#5-decide-what-to-print","title":"5. Decide what to print"},{"url":"#practice-before-continuing","title":"Practice before continuing"}]}]}}},"pageContext":{"title":"Beginner lessons","id":"cf0848ff-6110-5e16-bffd-0902c83eebdb"}},
    "staticQueryHashes": ["2197327828"]}