{"componentChunkName":"component---node-modules-smooth-doc-src-templates-doc-js","path":"/docs/basics/","result":{"data":{"mdx":{"fields":{"pageType":"doc","title":"Python Basics","editLink":""},"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"Python Basics\",\n  \"section\": \"Docs\",\n  \"order\": 2\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h1\", {\n    \"id\": \"python-basics\"\n  }, mdx(\"a\", {\n    parentName: \"h1\",\n    \"href\": \"#python-basics\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"Python Basics\"), mdx(\"p\", null, \"Before diving into the specific topics, let's briefly discuss Python's syntax and coding style. Python is known for its clean and readable syntax, which follows a set of guidelines called the \\\"Zen of Python.\\\" These guidelines emphasize simplicity, clarity, and readability. Python code is typically written using whitespace indentation instead of curly braces or keywords to define code blocks, making it visually distinct Python programs are usually written in plain text files with the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \".py\"), \" extension. You can run Python scripts from the command line or using an Integrated Development Environment (IDE) like PyCharm, Visual Studio Code, or Spyder \"), mdx(\"h2\", {\n    \"id\": \"1-variables-and-data-types\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#1-variables-and-data-types\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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. Variables and Data Types\"), mdx(\"p\", null, \"Variables in Python are used to store and manipulate data. Unlike some other programming languages, Python does not require explicit declaration of variable data types. The type of a variable is determined automatically based on the value assigned to it.\"), mdx(\"h3\", {\n    \"id\": \"i-assigning-values-to-variables\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-assigning-values-to-variables\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. Assigning Values to Variables\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 5       # Integer\\ny = 3.14    # Float\\nname = \\\"Alice\\\"  # String\\nis_student = True  # Boolean\\n\")), mdx(\"p\", null, \"Python supports various data types, including:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Integers\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"int\"), \"): Whole numbers, positive or negative (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"10\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"-5\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Floating-point numbers\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"float\"), \"): Decimal numbers (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"3.14\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"-0.5\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Strings\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"str\"), \"): Sequences of characters (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"\\\"Hello, World!\\\"\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"'Python'\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Booleans\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"bool\"), \"): Logical values \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"True\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"False\"), \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Lists\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"list\"), \"): Ordered collections of items (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"[1, 2, 3]\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"[\\\"apple\\\", \\\"banana\\\", \\\"orange\\\"]\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Tuples\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"tuple\"), \"): Immutable ordered collections (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"(1, 2, 3)\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"(\\\"apple\\\", \\\"banana\\\", \\\"orange\\\")\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Dictionaries\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"dict\"), \"): Unordered collections of key-value pairs (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 25}\"), \").\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Sets\"), \" (\", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"set\"), \"): Unordered collections of unique elements (e.g., \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"{1, 2, 3}\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"{\\\"apple\\\", \\\"banana\\\", \\\"orange\\\"}\"), \").\")), mdx(\"p\", null, \"You can check the type of a variable using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"type()\"), \" function:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 5\\nprint(type(x))  # Output: <class 'int'>\\n\")), mdx(\"h2\", {\n    \"id\": \"2-operators-and-expressions\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#2-operators-and-expressions\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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. Operators and Expressions\"), mdx(\"p\", null, \"Python provides a wide range of operators for performing various operations on variables and values.\"), mdx(\"h3\", {\n    \"id\": \"i-arithmetic-operators\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-arithmetic-operators\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. Arithmetic Operators\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"+\"), \" (Addition)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"-\"), \" (Subtraction)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"*\"), \" (Multiplication)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/\"), \" (Division)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"//\"), \" (Integer division)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"%\"), \" (Modulus)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"**\"), \" (Exponentiation)\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 10\\ny = 3\\nprint(x + y)  # Output: 13\\nprint(x - y)  # Output: 7\\nprint(x * y)  # Output: 30\\nprint(x / y)  # Output: 3.3333333333333335\\nprint(x // y)  # Output: 3 (integer division)\\nprint(x % y)  # Output: 1 (remainder)\\nprint(x ** y)  # Output: 1000 (10 raised to the power of 3)\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-assignment-operators\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-assignment-operators\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"ii. Assignment Operators\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"=\"), \" (Simple assignment)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"+=\"), \" (Add and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"-=\"), \" (Subtract and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"*=\"), \" (Multiply and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"/=\"), \" (Divide and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"//=\"), \" (Integer divide and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"%=\"), \" (Modulus and assign)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"**=\"), \" (Exponentiate and assign)\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 5\\nx += 3  # Same as x = x + 3\\nprint(x)  # Output: 8\\n\\ny = 10\\ny //= 3  # Same as y = y // 3\\nprint(y)  # Output: 3\\n\")), mdx(\"h3\", {\n    \"id\": \"iii-comparison-operators\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#iii-comparison-operators\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"iii. Comparison Operators\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"==\"), \" (Equal to)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"!=\"), \" (Not equal to)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \">\"), \" (Greater than)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"<\"), \" (Less than)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \">=\"), \" (Greater than or equal to)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"<=\"), \" (Less than or equal to)\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 5\\ny = 10\\nprint(x == y)  # Output: False\\nprint(x != y)  # Output: True\\nprint(x > y)   # Output: False\\nprint(x < y)   # Output: True\\nprint(x >= y)  # Output: False\\nprint(x <= y)  # Output: True\\n\")), mdx(\"h3\", {\n    \"id\": \"iv-logical-operators\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#iv-logical-operators\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"iv. Logical Operators\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"and\"), \" (Logical AND)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"or\"), \" (Logical OR)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"not\"), \" (Logical NOT)\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 5\\ny = 10\\nprint(x > 3 and y > 15)  # Output: False\\nprint(x > 3 or y > 15)   # Output: True\\nprint(not(x == y))       # Output: True\\n\")), mdx(\"h3\", {\n    \"id\": \"v-operator-precedence-and-parentheses\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#v-operator-precedence-and-parentheses\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"v. Operator Precedence and Parentheses\"), mdx(\"p\", null, \"Python follows the standard order of operations (PEMDAS: Parentheses, Exponents, Multiplication/Division, Addition/Subtraction). You can use parentheses to override the default precedence.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 10 + 3 * 2  # Result: 16 (multiplication takes precedence over addition)\\ny = (10 + 3) * 2  # Result: 26 (parentheses override precedence)\\n\")), mdx(\"h2\", {\n    \"id\": \"3-control-flow-conditionals-and-loops\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#3-control-flow-conditionals-and-loops\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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. Control Flow: Conditionals and Loops\"), mdx(\"p\", null, \"Control flow statements allow you to control the execution of your code based on certain conditions or to repeat a block of code multiple times.\"), mdx(\"h3\", {\n    \"id\": \"i-conditional-statements\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-conditional-statements\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. Conditional Statements\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"if\"), \" statement is used to execute different blocks of code based on specified conditions.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"age = 18\\n\\nif age >= 18:\\n    print(\\\"You are an adult.\\\")\\nelse:\\n    print(\\\"You are a minor.\\\")\\n\")), mdx(\"p\", null, \"You can also use \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"elif\"), \" (else if) to check multiple conditions:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"grade = 85\\n\\nif grade >= 90:\\n    print(\\\"Grade: A\\\")\\nelif grade >= 80:\\n    print(\\\"Grade: B\\\")\\nelif grade >= 70:\\n    print(\\\"Grade: C\\\")\\nelse:\\n    print(\\\"Grade: F\\\")\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-loops\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-loops\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"ii. Loops\"), mdx(\"p\", null, \"Loops in Python allow you to execute a block of code repeatedly based on certain conditions.\"), mdx(\"h4\", {\n    \"id\": \"a-for-loop\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-for-loop\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"a. \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"for\"), \" Loop\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"for\"), \" loop is used to iterate over a sequence (e.g., a list, tuple, string) or any other iterable object.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"fruits = [\\\"apple\\\", \\\"banana\\\", \\\"orange\\\"]\\n\\nfor fruit in fruits:\\n    print(fruit)\\n\")), mdx(\"p\", null, \"You can also use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"range()\"), \" function to generate a sequence of numbers:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"for i in range(5):\\n    print(i)  # Output: 0 1 2 3 4\\n\")), mdx(\"h4\", {\n    \"id\": \"b-while-loop\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-while-loop\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"b. \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"while\"), \" Loop\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"while\"), \" loop executes a block of code as long as a specified condition is true.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"count = 0\\nwhile count < 5:\\n    print(count)\\n    count += 1  # Output: 0 1 2 3 4\\n\")), mdx(\"p\", null, \"You can use the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"break\"), \" statement to exit a loop prematurely, and the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"continue\"), \" statement to skip the current iteration and move to the next one.\"), mdx(\"h2\", {\n    \"id\": \"4-f-strings-formatted-string-literals\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#4-f-strings-formatted-string-literals\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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. F-Strings (Formatted String Literals)\"), mdx(\"p\", null, \"Python 3.6 introduced a new way of formatting strings called \\\"formatted string literals\\\" or \\\"f-strings\\\" for short. F-strings provide a concise and more readable way of embedding expressions inside string literals.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"name = \\\"Alice\\\"\\nage = 25\\n\\n# Old way of string formatting\\nprint(\\\"My name is {} and I'm {} years old.\\\".format(name, age))\\n\\n# Using f-strings\\nprint(f\\\"My name is {name} and I'm {age} years old.\\\")\\n\")), mdx(\"p\", null, \"In the example above, the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"f\"), \" before the string literal \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"My name is {name} and I'm {age} years old.\\\"\"), \" is what makes it an f-string. Inside the curly braces \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"{}\"), \", you can put any valid Python expression, which will be evaluated and inserted into the resulting string.\"), mdx(\"p\", null, \"F-strings also support more advanced formatting options, such as formatting numbers, aligning text, and handling data types.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"pi = 3.14159\\nprint(f\\\"The value of pi is approximately {pi:.2f}\\\")  # Output: The value of pi is approximately 3.14\\n\\n# Aligning text\\nname = \\\"Alice\\\"\\nprint(f\\\"{name:>10}\\\") # Output: \\\"     Alice\\\" (aligned to the right with 10 spaces)\\n\\n# Handling data types\\nvalue = 42\\nprint(f\\\"{value} is {type(value).__name__}\\\") # Output: \\\"42 is int\\\"\\n\")), mdx(\"p\", null, \"In the examples above, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"{pi:.2f}\"), \" formats the float value of \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"pi\"), \" to two decimal places, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"{name:>10}\"), \" right-aligns the string \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"name\"), \" with 10 spaces, and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"{type(value).__name__}\"), \" gets the name of the data type of \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"value\"), \" as a string.\"), mdx(\"p\", null, \"F-strings provide a more readable and expressive way of formatting strings in Python, especially when dealing with complex expressions or multiple substitutions.\"), mdx(\"h2\", {\n    \"id\": \"5-functions-and-modules\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#5-functions-and-modules\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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. Functions and Modules\"), mdx(\"p\", null, \"Functions in Python are reusable blocks of code that perform specific tasks. They help to organize and modularize your code, making it more readable and maintainable.\"), mdx(\"h3\", {\n    \"id\": \"i-defining-functions\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-defining-functions\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. Defining Functions\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"def greet(name):\\n    \\\"\\\"\\\"This function greets the given person.\\\"\\\"\\\"\\n    print(f\\\"Hello, {name}!\\\")\\n\\ngreet(\\\"Alice\\\")  # Output: Hello, Alice!\\n\")), mdx(\"p\", null, \"Functions can accept parameters (inputs) and return values (outputs). The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"return\"), \" statement is used to return a value from a function.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"def add_numbers(x, y):\\n    \\\"\\\"\\\"This function adds two numbers.\\\"\\\"\\\"\\n    result = x + y\\n    return result\\n\\nsum = add_numbers(3, 5)\\nprint(sum)  # Output: 8\\n\")), mdx(\"p\", null, \"Python also supports default parameter values, arbitrary arguments (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*args\"), \"), and keyword arguments (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"**kwargs\"), \").\"), mdx(\"h3\", {\n    \"id\": \"ii-modules-and-packages\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-modules-and-packages\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"ii. Modules and Packages\"), mdx(\"p\", null, \"Modules in Python are files containing Python code (functions, classes, variables, etc.). They allow you to organize and reuse code across different parts of your program or across multiple programs.\"), mdx(\"p\", null, \"To use a module in your Python script, you need to import it first.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"# my_module.py\\ndef greet(name):\\n    print(f\\\"Hello, {name}!\\\")\\n\\n# main.py\\nimport my_module\\n\\nmy_module.greet(\\\"Alice\\\")  # Output: Hello, Alice!\\n\")), mdx(\"p\", null, \"You can also import specific functions or variables from a module using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"from\"), \" keyword:\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"from my_module import greet\\n\\ngreet(\\\"Alice\\\")  # Output: Hello, Alice!\\n\")), mdx(\"p\", null, \"Python comes with a vast standard library of modules that provide a wide range of functionality, from file I/O to networking, web development, and more. Some commonly used standard library modules include \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"math\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"os\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"sys\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"datetime\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"re\"), \".\"), mdx(\"p\", null, \"Packages are collections of modules that allow for better organization and modularity of larger Python projects. Each package is a directory containing one or more module files, along with an \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"__init__.py\"), \" file that marks the directory as a Python package.\"), mdx(\"h2\", {\n    \"id\": \"6-comments\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#6-comments\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"6. Comments\"), mdx(\"p\", null, \"Comments in Python are a way to add explanatory notes or annotations to your code. They are ignored by the Python interpreter and do not affect the execution of the program. Comments are essential for improving code readability, documenting complex logic, and leaving notes for future reference.\"), mdx(\"p\", null, \"Python supports two types of comments: single-line comments and multi-line comments.\"), mdx(\"h3\", {\n    \"id\": \"i-single-line-comments\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-single-line-comments\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. Single-Line Comments\"), mdx(\"p\", null, \"Single-line comments start with the hash symbol (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"#\"), \"), and they extend to the end of the line. Any text following the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"#\"), \" symbol on the same line is considered a comment and is ignored by the Python interpreter.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"# This is a single-line comment\\n\\nx = 5  # This is a variable assignment\\nprint(x)  # Output: 5\\n\")), mdx(\"p\", null, \"Single-line comments can be placed at the beginning of a line or at the end of a line after some code.\"), mdx(\"h3\", {\n    \"id\": \"ii-multi-line-comments\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-multi-line-comments\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"ii. Multi-Line Comments\"), mdx(\"p\", null, \"Python does not have a built-in syntax for multi-line comments. However, there are a few ways to achieve multi-line comments:\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Using multiple single-line comments\"), \":\"), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"# This is a multi-line comment\\n# written using multiple\\n# single-line comments\\n\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Using multi-line strings\"), \":\\nMulti-line strings (enclosed in triple quotes \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"\\\"\\\"\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"'''\"), \") can be used as comments, although they are not technically comments and will still be parsed by the Python interpreter.\"), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"\\\"\\\"\\\"\\nThis is a multi-line comment\\nwritten using a multi-line string.\\n\\\"\\\"\\\"\\n\\nprint(\\\"Hello, World!\\\")\\n\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"p\", {\n    parentName: \"li\"\n  }, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Using docstrings\"), \":\\nDocstrings are multi-line strings used to document functions, modules, or classes. Although their primary purpose is documentation, they can also serve as multi-line comments.\"), mdx(\"pre\", {\n    parentName: \"li\"\n  }, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"def my_function():\\n    \\\"\\\"\\\"\\n    This is a docstring that can serve\\n    as a multi-line comment, explaining\\n    what the function does.\\n    \\\"\\\"\\\"\\n    print(\\\"Hello from my_function!\\\")\\n\")))), mdx(\"p\", null, \"While single-line comments are more common for short explanations, multi-line comments or docstrings are useful for providing longer, more detailed explanations or documentation for your code.\"), mdx(\"p\", null, \"It's considered a good practice to use comments judiciously to explain complex logic, document code behavior, or provide context for future reference. However, comments should not replace clear and self-documenting code. Strive for a balance between well-written code and appropriate use of comments for better code readability and maintainability.\"), mdx(\"h2\", {\n    \"id\": \"7-input-and-output-operation\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#7-input-and-output-operation\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"7. Input and Output Operation\"), mdx(\"p\", null, \"Python provides several built-in functions for handling input and output operations, such as reading data from the user or writing data to files.\"), mdx(\"h3\", {\n    \"id\": \"i-user-input\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-user-input\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"i. User Input\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"input()\"), \" function is used to get input from the user through the command line or terminal.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"name = input(\\\"Enter your name: \\\")\\nprint(f\\\"Hello, {name}!\\\")\\n\")), mdx(\"p\", null, \"By default, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"input()\"), \" returns a string. If you need to get input of a different data type, you can perform type conversion explicitly.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"age = int(input(\\\"Enter your age: \\\"))\\nprint(f\\\"You are {age} years old.\\\")\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-file-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-file-operations\",\n    \"aria-hidden\": true,\n    \"className\": \"anchor\"\n  }, mdx(\"svg\", {\n    \"aria-hidden\": \"true\",\n    height: \"16\",\n    version: \"1.1\",\n    viewBox: \"0 0 16 16\",\n    width: \"16\"\n  }, mdx(\"path\", {\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  }))), \"ii. File Operations\"), mdx(\"p\", null, \"Python provides various functions and methods for working with files. The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"open()\"), \" function is used to open a file for reading or writing.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"# Writing to a file\\nwith open(\\\"data.txt\\\", \\\"w\\\") as file:\\n    file.write(\\\"Hello, World!\\\")\\n\\n# Reading from a file\\nwith open(\\\"data.txt\\\", \\\"r\\\") as file:\\n    content = file.read()\\n    print(content)  # Output: Hello, World!\\n\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"with\"), \" statement is used to ensure that the file is properly closed after use, even if an exception occurs.\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"open()\"), \" function accepts multiple modes for file operations, such as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"r\\\"\"), \" (read), \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"w\\\"\"), \" (write), \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"a\\\"\"), \" (append), and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"\\\"b\\\"\"), \" (binary).\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"# Appending to a file\\nwith open(\\\"data.txt\\\", \\\"a\\\") as file:\\n    file.write(\\\"\\\\nThis is a new line.\\\")\\n\")), mdx(\"p\", null, \"You can also use other file methods like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"read()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"readline()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"readlines()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"write()\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"writelines()\"), \" to perform various file operations.\"), mdx(\"hr\", null), mdx(\"p\", null, \"We covered the fundamental topics of variables and data types, operators and expressions, control flow statements, functions and modules, and input/output operations in Python.\"));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#python-basics","title":"Python Basics","items":[{"url":"#1-variables-and-data-types","title":"1. Variables and Data Types","items":[{"url":"#i-assigning-values-to-variables","title":"i. Assigning Values to Variables"}]},{"url":"#2-operators-and-expressions","title":"2. Operators and Expressions","items":[{"url":"#i-arithmetic-operators","title":"i. Arithmetic Operators"},{"url":"#ii-assignment-operators","title":"ii. Assignment Operators"},{"url":"#iii-comparison-operators","title":"iii. Comparison Operators"},{"url":"#iv-logical-operators","title":"iv. Logical Operators"},{"url":"#v-operator-precedence-and-parentheses","title":"v. Operator Precedence and Parentheses"}]},{"url":"#3-control-flow-conditionals-and-loops","title":"3. Control Flow: Conditionals and Loops","items":[{"url":"#i-conditional-statements","title":"i. Conditional Statements"},{"url":"#ii-loops","title":"ii. Loops","items":[{"url":"#a-for-loop","title":"a. for Loop"},{"url":"#b-while-loop","title":"b. while Loop"}]}]},{"url":"#4-f-strings-formatted-string-literals","title":"4. F-Strings (Formatted String Literals)"},{"url":"#5-functions-and-modules","title":"5. Functions and Modules","items":[{"url":"#i-defining-functions","title":"i. Defining Functions"},{"url":"#ii-modules-and-packages","title":"ii. Modules and Packages"}]},{"url":"#6-comments","title":"6. Comments","items":[{"url":"#i-single-line-comments","title":"i. Single-Line Comments"},{"url":"#ii-multi-line-comments","title":"ii. Multi-Line Comments"}]},{"url":"#7-input-and-output-operation","title":"7. Input and Output Operation","items":[{"url":"#i-user-input","title":"i. User Input"},{"url":"#ii-file-operations","title":"ii. File Operations"}]}]}]}}},"pageContext":{"id":"93b4314e-6e7e-55f5-a768-60deb79ce92f"}},"staticQueryHashes":["1022386572","1122327541","1339625561","2140385554","3442269102","3597609067"]}