{"componentChunkName":"component---node-modules-smooth-doc-src-templates-doc-js","path":"/docs/datastruct/","result":{"data":{"mdx":{"fields":{"pageType":"doc","title":"Data Structures","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\": \"Data Structures\",\n  \"section\": \"Docs\",\n  \"order\": 3\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\": \"data-structures\"\n  }, mdx(\"a\", {\n    parentName: \"h1\",\n    \"href\": \"#data-structures\",\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  }))), \"Data Structures\"), mdx(\"p\", null, \"Python provides a wide range of built-in data structures that allow you to store and organize data in different ways. Understanding these data structures, their characteristics, and the operations and methods that can be performed on them is crucial for writing efficient and readable code. In this comprehensive document, we'll explore the different data structures available in Python, their use cases, and the various operations and methods associated with each data type.\"), mdx(\"h2\", {\n    \"id\": \"1-text-type-str\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#1-text-type-str\",\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. Text Type: \", mdx(\"inlineCode\", {\n    parentName: \"h2\"\n  }, \"str\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"str\"), \" (string) data type in Python is used to represent a sequence of characters. Strings are immutable, meaning their values cannot be changed after they are created.\"), mdx(\"h3\", {\n    \"id\": \"i-operations-and-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-operations-and-methods\",\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. Operations and Methods\"), mdx(\"h4\", {\n    \"id\": \"a-string-indexing-and-slicing\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-string-indexing-and-slicing\",\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. String Indexing and Slicing\"), mdx(\"p\", null, \"Strings support indexing and slicing operations, which allow you to access individual characters or substrings.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"name = \\\"Alice\\\"\\nprint(name[0])  # Output: 'A'\\nprint(name[-1])  # Output: 'e'\\nprint(name[1:4])  # Output: 'lic'\\n\")), mdx(\"h4\", {\n    \"id\": \"b-string-concatenation\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-string-concatenation\",\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. String Concatenation\"), mdx(\"p\", null, \"Strings can be concatenated using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"+\"), \" operator or the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"join()\"), \" method.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"first_name = \\\"Alice\\\"\\nlast_name = \\\"Smith\\\"\\nfull_name = first_name + \\\" \\\" + last_name  # Concatenation with +\\nprint(full_name)  # Output: Alice Smith\\n\\nnames = [\\\"Alice\\\", \\\"Bob\\\", \\\"Charlie\\\"]\\njoined_names = \\\", \\\".join(names)  # Concatenation with join()\\nprint(joined_names)  # Output: Alice, Bob, Charlie\\n\")), mdx(\"h4\", {\n    \"id\": \"c-string-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#c-string-methods\",\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  }))), \"c. String Methods\"), mdx(\"p\", null, \"Strings provide many built-in methods for performing various operations, such as:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"upper()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"lower()\"), \": Convert the string to uppercase or lowercase.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"strip()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"lstrip()\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"rstrip()\"), \": Remove whitespace characters from the start, end, or both ends of the string.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"replace()\"), \": Replace occurrences of a substring with another substring.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"split()\"), \": Split a string into a list of substrings based on a delimiter.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"join()\"), \": Join a list of strings into a single string using a delimiter.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"find()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"index()\"), \": Find the index of a substring within the string.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"startswith()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"endswith()\"), \": Check if the string starts or ends with a specified substring.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"message = \\\"  Hello, World!  \\\"\\nprint(message.strip())  # Output: \\\"Hello, World!\\\"\\nprint(message.replace(\\\"World\\\", \\\"Python\\\"))  # Output: \\\"  Hello, Python!  \\\"\\nwords = message.split(\\\",\\\")\\nprint(words)  # Output: ['  Hello', ' World!  ']\\n\")), mdx(\"h4\", {\n    \"id\": \"d-string-formatting\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#d-string-formatting\",\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  }))), \"d. String Formatting\"), mdx(\"p\", null, \"Python provides various ways to format strings, including f-strings (formatted string literals), the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"format()\"), \" method, and the older \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"%\"), \" operator.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"name = \\\"Alice\\\"\\nage = 25\\nprint(f\\\"My name is {name} and I'm {age} years old.\\\")  # f-strings\\nprint(\\\"My name is {} and I'm {} years old.\\\".format(name, age))  # format() method\\nprint(\\\"My name is %s and I'm %d years old.\\\" % (name, age))  # % operator\\n\")), mdx(\"h2\", {\n    \"id\": \"2-numeric-types\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#2-numeric-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  }))), \"2. Numeric Types\"), mdx(\"p\", null, \"Python provides three main numeric data types: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"int\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"float\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"complex\"), \".\"), mdx(\"h3\", {\n    \"id\": \"i-int-integer\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-int-integer\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"int\"), \" (Integer)\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"int\"), \" data type represents positive or negative whole numbers without a fractional part.\"), mdx(\"h4\", {\n    \"id\": \"a-integer-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-integer-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  }))), \"a. Integer Operations\"), mdx(\"p\", null, \"Integers support various arithmetic operations like addition (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"+\"), \"), subtraction (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"-\"), \"), multiplication (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*\"), \"), division (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"//\"), \" for integer division, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"/\"), \" for float division), modulus (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"%\"), \"), and exponentiation (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"**\"), \").\"), 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 (integer division)\\nprint(x % y)  # Output: 1 (modulus)\\nprint(x ** y)  # Output: 1000 (exponentiation)\\n\")), mdx(\"h4\", {\n    \"id\": \"b-integer-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-integer-methods\",\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. Integer Methods\"), mdx(\"p\", null, \"Integers provide a few built-in methods, such as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bit_length()\"), \" (to get the number of bits required to represent the integer) and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"to_bytes()\"), \" (to convert the integer to a bytes object).\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 42\\nprint(x.bit_length())  # Output: 6 (number of bits required to represent 42)\\nprint(x.to_bytes(2, byteorder='big'))  # Output: b'\\\\x00*' (bytes representation of 42)\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-float-floating-point-number\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-float-floating-point-number\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"float\"), \" (Floating-Point Number)\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"float\"), \" data type represents numbers with a fractional part.\"), mdx(\"h4\", {\n    \"id\": \"a-float-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-float-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  }))), \"a. Float Operations\"), mdx(\"p\", null, \"Floating-point numbers support the same arithmetic operations as integers, with the addition of the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"/\"), \" operator for floating-point division.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 3.14\\ny = 2.0\\nprint(x + y)  # Output: 5.14\\nprint(x - y)  # Output: 1.14\\nprint(x * y)  # Output: 6.28\\nprint(x / y)  # Output: 1.57 (floating-point division)\\n\")), mdx(\"h4\", {\n    \"id\": \"b-float-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-float-methods\",\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. Float Methods\"), mdx(\"p\", null, \"Floating-point numbers provide several built-in methods, including \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"as_integer_ratio()\"), \" (to convert the float to a numerator and denominator pair), \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"is_integer()\"), \" (to check if the float is an integer), and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"hex()\"), \" (to convert the float to a hexadecimal string).\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = 3.14\\nprint(x.as_integer_ratio())  # Output: (3141, 1000) (numerator and denominator pair)\\nprint(x.is_integer())  # Output: False\\nprint(x.hex())  # Output: '0x1.91eb851eb851fp+1' (hexadecimal representation)\\n\")), mdx(\"h3\", {\n    \"id\": \"iii-complex-complex-number\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#iii-complex-complex-number\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"complex\"), \" (Complex Number)\"), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"complex\"), \" data type represents complex numbers, which consist of a real and an imaginary part.\"), mdx(\"h4\", {\n    \"id\": \"a-complex-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-complex-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  }))), \"a. Complex Operations\"), mdx(\"p\", null, \"Complex numbers support arithmetic operations like addition, subtraction, multiplication, division, and exponentiation, as well as methods like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"conjugate()\"), \" (to get the complex conjugate) and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"imag\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"real\"), \" (to access the imaginary and real parts, respectively).\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"z = 2 + 3j\\nprint(z + 1)  # Output: (3+3j)\\nprint(z * 2)  # Output: (4+6j)\\nprint(z.conjugate())  # Output: (2-3j)\\nprint(z.real)  # Output: 2.0\\nprint(z.imag)  # Output: 3.0\\n\")), mdx(\"h2\", {\n    \"id\": \"3-sequence-types\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#3-sequence-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  }))), \"3. Sequence Types\"), mdx(\"p\", null, \"Python provides three sequence data types: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"list\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"tuple\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"range\"), \". These data structures are used to store ordered collections of items.\"), mdx(\"h3\", {\n    \"id\": \"i-list\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-list\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"list\")), mdx(\"p\", null, \"A \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"list\"), \" is an ordered collection of items that can be of different data types. Lists are mutable, meaning their elements can be modified after creation.\"), mdx(\"h4\", {\n    \"id\": \"a-list-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-list-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  }))), \"a. List Operations\"), mdx(\"p\", null, \"Lists support various operations like indexing, slicing, concatenation, repetition, membership testing, and more.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"fruits = [\\\"apple\\\", \\\"banana\\\", \\\"cherry\\\"]\\nprint(fruits[0])  # Output: 'apple'\\nprint(fruits[-1])  # Output: 'cherry'\\nprint(fruits[1:3])  # Output: ['banana', 'cherry']\\nprint(fruits + [\\\"orange\\\"])  # Output: ['apple', 'banana', 'cherry', 'orange']\\nprint(fruits * 2)  # Output: ['apple', 'banana', 'cherry', 'apple', 'banana', 'cherry']\\nprint(\\\"apple\\\" in fruits)  # Output: True\\n\")), mdx(\"h4\", {\n    \"id\": \"b-list-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-list-methods\",\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. List Methods\"), mdx(\"p\", null, \"Lists provide many built-in methods for performing various operations, such as:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"append()\"), \": Add an item to the end of the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"insert()\"), \": Insert an item at a specified index.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"remove()\"), \": Remove the first occurrence of an item from the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"pop()\"), \": Remove and return the item at a specified index (or the last item if no index is provided).\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"index()\"), \": Return the index of the first occurrence of an item in the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"count()\"), \": Return the number of occurrences of an item in the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"sort()\"), \": Sort the list in ascending order (optionally, you can provide a custom sorting function).\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"reverse()\"), \": Reverse the order of the items in the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"extend()\"), \": Add multiple items from another iterable (e.g., list, tuple, or range) to the end of the list.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"copy()\"), \": Create a shallow copy of the list.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"fruits = [\\\"apple\\\", \\\"banana\\\", \\\"cherry\\\"]\\nfruits.append(\\\"orange\\\")\\nprint(fruits)  # Output: ['apple', 'banana', 'cherry', 'orange']\\n\\nfruits.insert(1, \\\"grape\\\")\\nprint(fruits)  # Output: ['apple', 'grape', 'banana', 'cherry', 'orange']\\n\\nfruits.remove(\\\"banana\\\")\\nprint(fruits)  # Output: ['apple', 'grape', 'cherry', 'orange']\\n\\nprint(fruits.pop(1))  # Output: 'grape'\\nprint(fruits)  # Output: ['apple', 'cherry', 'orange']\\n\\nfruits.extend([\\\"kiwi\\\", \\\"mango\\\"])\\nprint(fruits)  # Output: ['apple', 'cherry', 'orange', 'kiwi', 'mango']\\n\\nfruits.sort()\\nprint(fruits)  # Output: ['apple', 'cherry', 'kiwi', 'mango', 'orange']\\n\\nfruits.reverse()\\nprint(fruits)  # Output: ['orange', 'mango', 'kiwi', 'cherry', 'apple']\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-tuple\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-tuple\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"tuple\")), mdx(\"p\", null, \"A \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"tuple\"), \" is an ordered collection of items similar to a list, but it is immutable, meaning its elements cannot be modified after creation.\"), mdx(\"h4\", {\n    \"id\": \"a-tuple-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-tuple-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  }))), \"a. Tuple Operations\"), mdx(\"p\", null, \"Tuples support operations like indexing, slicing, concatenation, repetition, and membership testing, similar to lists.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"point = (3, 4)\\nprint(point[0])  # Output: 3\\nprint(point[-1])  # Output: 4\\nprint(point[:1])  # Output: (3,)\\nprint(point + (5, 6))  # Output: (3, 4, 5, 6)\\nprint(point * 2)  # Output: (3, 4, 3, 4)\\nprint(3 in point)  # Output: True\\n\")), mdx(\"h4\", {\n    \"id\": \"b-tuple-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-tuple-methods\",\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. Tuple Methods\"), mdx(\"p\", null, \"Tuples have fewer built-in methods compared to lists because they are immutable. The most commonly used methods are \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"count()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"index()\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"colors = (\\\"red\\\", \\\"green\\\", \\\"blue\\\", \\\"red\\\")\\nprint(colors.count(\\\"red\\\"))  # Output: 2\\nprint(colors.index(\\\"green\\\"))  # Output: 1\\n\")), mdx(\"h3\", {\n    \"id\": \"iii-range\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#iii-range\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"range\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"range\"), \" data type represents an immutable sequence of numbers. It is commonly used in loops to iterate over a specific range of values.\"), mdx(\"h4\", {\n    \"id\": \"a-creating-a-range\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-creating-a-range\",\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. Creating a \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"range\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"range()\"), \" function takes one, two, or three arguments:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"range(stop)\"), \": Creates a range from 0 to \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"stop - 1\"), \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"range(start, stop)\"), \": Creates a range from \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"start\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"stop - 1\"), \".\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"range(start, stop, step)\"), \": Creates a range from \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"start\"), \" to \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"stop - 1\"), \", incrementing by \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"step\"), \".\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"print(list(range(5)))  # Output: [0, 1, 2, 3, 4]\\nprint(list(range(2, 6)))  # Output: [2, 3, 4, 5]\\nprint(list(range(1, 10, 2)))  # Output: [1, 3, 5, 7, 9]\\n\")), mdx(\"h4\", {\n    \"id\": \"b-range-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-range-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  }))), \"b. \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"range\"), \" Operations\"), mdx(\"p\", null, \"Ranges support indexing, slicing, and membership testing, similar to other sequences.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"r = range(5)\\nprint(r[2])  # Output: 2\\nprint(list(r[1:4]))  # Output: [1, 2, 3]\\nprint(3 in r)  # Output: True\\n\")), mdx(\"p\", null, \"However, ranges do not support item assignment or other mutable operations since they are immutable.\"), mdx(\"h2\", {\n    \"id\": \"4-mapping-type-dict\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#4-mapping-type-dict\",\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. Mapping Type: \", mdx(\"inlineCode\", {\n    parentName: \"h2\"\n  }, \"dict\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"dict\"), \" (dictionary) data type in Python is an unordered collection of key-value pairs. Dictionaries are mutable and allow for efficient retrieval and storage of data using keys.\"), mdx(\"h4\", {\n    \"id\": \"a-dictionary-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-dictionary-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  }))), \"a. Dictionary Operations\"), mdx(\"p\", null, \"Dictionaries support various operations like indexing (using keys), updating values, deleting items, membership testing (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"in\"), \" operator), and more.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"person = {\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 25, \\\"city\\\": \\\"New York\\\"}\\nprint(person[\\\"name\\\"])  # Output: 'Alice'\\nperson[\\\"age\\\"] = 26\\nprint(person)  # Output: {'name': 'Alice', 'age': 26, 'city': 'New York'}\\ndel person[\\\"city\\\"]\\nprint(person)  # Output: {'name': 'Alice', 'age': 26}\\nprint(\\\"occupation\\\" in person)  # Output: False\\n\")), mdx(\"h4\", {\n    \"id\": \"b-dictionary-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-dictionary-methods\",\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. Dictionary Methods\"), mdx(\"p\", null, \"Dictionaries provide several built-in methods for managing and manipulating their contents, such as:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"keys()\"), \": Return a view object containing the dictionary's keys.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"values()\"), \": Return a view object containing the dictionary's values.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"items()\"), \": Return a view object containing the dictionary's key-value pairs as tuples.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"get()\"), \": Return the value associated with a key, or a default value if the key is not found.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"pop()\"), \": Remove and return the value associated with a key (optional default value if the key is not found).\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"update()\"), \": Update the dictionary with key-value pairs from another dictionary or an iterable of key-value pairs.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"clear()\"), \": Remove all items from the dictionary.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"person = {\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 25, \\\"city\\\": \\\"New York\\\"}\\nprint(list(person.keys()))  # Output: ['name', 'age', 'city']\\nprint(list(person.values()))  # Output: ['Alice', 25, 'New York']\\nprint(list(person.items()))  # Output: [('name', 'Alice'), ('age', 25), ('city', 'New York')]\\n\\nprint(person.get(\\\"occupation\\\", \\\"Unknown\\\"))  # Output: 'Unknown'\\nprint(person.pop(\\\"city\\\"))  # Output: 'New York'\\nprint(person)  # Output: {'name': 'Alice', 'age': 25}\\n\\nperson.update({\\\"occupation\\\": \\\"Engineer\\\", \\\"age\\\": 26})\\nprint(person)  # Output: {'name': 'Alice', 'age': 26, 'occupation': 'Engineer'}\\n\\nperson.clear()\\nprint(person)  # Output: {}\\n\")), mdx(\"h2\", {\n    \"id\": \"5-set-types\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#5-set-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  }))), \"5. Set Types\"), mdx(\"p\", null, \"Python provides two set data types: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"set\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \".\"), mdx(\"h3\", {\n    \"id\": \"i-set\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-set\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"set\")), mdx(\"p\", null, \"A \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"set\"), \" is an unordered collection of unique elements. Sets are mutable, meaning you can add or remove elements after creation.\"), mdx(\"h4\", {\n    \"id\": \"a-set-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-set-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  }))), \"a. Set Operations\"), mdx(\"p\", null, \"Sets support various operations like union (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"|\"), \"), intersection (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"&\"), \"), difference (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"-\"), \"), symmetric difference (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"^\"), \"), and membership testing (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"in\"), \" operator).\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"colors = {\\\"red\\\", \\\"green\\\", \\\"blue\\\"}\\nprint(\\\"red\\\" in colors)  # Output: True\\nprint(colors & {\\\"blue\\\", \\\"yellow\\\"})  # Output: {'blue'}\\nprint(colors | {\\\"yellow\\\", \\\"purple\\\"})  # Output: {'red', 'green', 'blue', 'yellow', 'purple'}\\nprint(colors - {\\\"blue\\\", \\\"yellow\\\"})  # Output: {'red', 'green'}\\nprint(colors ^ {\\\"blue\\\", \\\"yellow\\\"})  # Output: {'red', 'green', 'yellow'}\\n\")), mdx(\"h4\", {\n    \"id\": \"b-set-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-set-methods\",\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. Set Methods\"), mdx(\"p\", null, \"Sets provide various built-in methods for performing operations and manipulating their contents, such as:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"add()\"), \": Add an element to the set.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"update()\"), \": Add multiple elements from another iterable (e.g., list, tuple, or range) to the set.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"remove()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"discard()\"), \": Remove an element from the set (with \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"discard()\"), \", no error is raised if the element is not found).\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"pop()\"), \": Remove and return an arbitrary element from the set.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"clear()\"), \": Remove all elements from the set.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"union()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"intersection()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"difference()\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"symmetric_difference()\"), \": Perform set operations and return a new set.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"issubset()\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"issuperset()\"), \": Check if a set is a subset or superset of another set, respectively.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"isdisjoint()\"), \": Check if two sets have no elements in common.\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"copy()\"), \": Create a shallow copy of the set.\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"colors = {\\\"red\\\", \\\"green\\\", \\\"blue\\\"}\\ncolors.add(\\\"yellow\\\")\\nprint(colors)  # Output: {'red', 'green', 'blue', 'yellow'}\\n\\ncolors.update([\\\"purple\\\", \\\"orange\\\"])\\nprint(colors)  # Output: {'orange', 'red', 'purple', 'green', 'blue', 'yellow'}\\n\\ncolors.remove(\\\"orange\\\")\\nprint(colors)  # Output: {'red', 'purple', 'green', 'blue', 'yellow'}\\n\\nprint(colors.pop())  # Output: 'red' (arbitrary element is removed and returned)\\nprint(colors)  # Output: {'purple', 'green', 'blue', 'yellow'}\\n\\ncolors.clear()\\nprint(colors)  # Output: set()\\n\\nset1 = {1, 2, 3}\\nset2 = {2, 3, 4}\\nprint(set1.union(set2))  # Output: {1, 2, 3, 4}\\nprint(set1.intersection(set2))  # Output: {2, 3}\\nprint(set1.difference(set2))  # Output: {1}\\nprint(set1.symmetric_difference(set2))  # Output: {1, 4}\\n\\nset3 = {1, 2}\\nset4 = {1, 2, 3, 4}\\nprint(set3.issubset(set4))  # Output: True\\nprint(set4.issuperset(set3))  # Output: True\\n\\nset5 = {1, 2}\\nset6 = {3, 4}\\nprint(set5.isdisjoint(set6))  # Output: True\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-frozenset\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-frozenset\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"frozenset\")), mdx(\"p\", null, \"A \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" is an immutable version of a set. Once a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" is created, you cannot add or remove elements.\"), mdx(\"h4\", {\n    \"id\": \"a-creating-a-frozenset\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-creating-a-frozenset\",\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. Creating a \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"frozenset\")), mdx(\"p\", null, \"You can create a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset()\"), \" constructor, passing an iterable (e.g., list, tuple, or set) as an argument.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"numbers = frozenset([1, 2, 3, 4, 5])\\nprint(numbers)  # Output: frozenset({1, 2, 3, 4, 5})\\n\")), mdx(\"h4\", {\n    \"id\": \"b-frozenset-operations-and-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-frozenset-operations-and-methods\",\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  }, \"frozenset\"), \" Operations and Methods\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" objects support the same set operations as regular sets (e.g., union, intersection, difference, symmetric difference) and membership testing. However, since they are immutable, methods like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"add()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"remove()\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"clear()\"), \" are not available.\"), mdx(\"p\", null, \"The most commonly used methods for \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" are \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"issubset()\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"issuperset()\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"isdisjoint()\"), \", which work the same way as for regular sets.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"frozen_set = frozenset([1, 2, 3])\\nregular_set = {2, 3, 4}\\n\\nprint(frozen_set.issubset(regular_set))  # Output: False\\nprint(frozen_set.issuperset(regular_set))  # Output: False\\nprint(frozen_set.isdisjoint(regular_set))  # Output: False\\n\\nprint(frozen_set & regular_set)  # Output: frozenset({2, 3})\\nprint(frozen_set | regular_set)  # Output: frozenset({1, 2, 3, 4})\\n\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"frozenset\"), \" objects are hashable, meaning they can be used as keys in dictionaries or elements in other sets, unlike regular mutable sets.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"my_dict = {frozenset({1, 2, 3}): \\\"Value\\\"}\\nprint(my_dict)  # Output: {frozenset({1, 2, 3}): 'Value'}\\n\")), mdx(\"h2\", {\n    \"id\": \"6-boolean-type-bool\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#6-boolean-type-bool\",\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. Boolean Type: \", mdx(\"inlineCode\", {\n    parentName: \"h2\"\n  }, \"bool\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bool\"), \" data type in Python represents a boolean value, which can be either \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"True\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \". Booleans are commonly used in conditional statements and logical operations.\"), mdx(\"h4\", {\n    \"id\": \"a-boolean-operations\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-boolean-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  }))), \"a. Boolean Operations\"), mdx(\"p\", null, \"Booleans support logical operations like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"and\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"or\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"not\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = True\\ny = False\\n\\nprint(x and y)  # Output: False\\nprint(x or y)  # Output: True\\nprint(not x)  # Output: False\\n\")), mdx(\"h4\", {\n    \"id\": \"b-truthiness\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-truthiness\",\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. Truthiness\"), mdx(\"p\", null, \"In Python, values of any data type can be evaluated as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"True\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \" in a boolean context. This concept is known as \\\"truthiness.\\\" Some values are considered \\\"falsy\\\" (evaluating to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \"), while others are considered \\\"truthy\\\" (evaluating to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"True\"), \").\"), mdx(\"p\", null, \"The following values are considered falsy:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"False\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"None\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"0\"), \" (integer zero)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"0.0\"), \" (float zero)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"''\"), \" (empty string)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"[]\"), \" (empty list)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"()\"), \" (empty tuple)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"{}\"), \" (empty dictionary)\"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"set()\"), \" (empty set)\")), mdx(\"p\", null, \"All other values are considered truthy, including non-empty containers, non-zero numbers, and any custom objects.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"print(bool(0))  # Output: False\\nprint(bool(42))  # Output: True\\nprint(bool(\\\"\\\"))  # Output: False\\nprint(bool(\\\"Hello\\\"))  # Output: True\\nprint(bool([]))  # Output: False\\nprint(bool([1, 2, 3]))  # Output: True\\n\")), mdx(\"p\", null, \"Truthiness is often used in conditional statements and loops to check if a value exists or is non-empty.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"name = input(\\\"Enter your name: \\\")\\nif name:\\n    print(f\\\"Hello, {name}!\\\")\\nelse:\\n    print(\\\"You didn't enter a name.\\\")\\n\")), mdx(\"h2\", {\n    \"id\": \"7-binary-types\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#7-binary-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  }))), \"7. Binary Types\"), mdx(\"p\", null, \"Python provides three binary data types: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \", \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \", and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \". These data types are used to handle binary data, such as data from network sockets, files, or low-level system operations.\"), mdx(\"h3\", {\n    \"id\": \"i-bytes\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#i-bytes\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"bytes\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" data type represents an immutable sequence of bytes. It is useful for handling binary data in a fixed-length format.\"), mdx(\"h4\", {\n    \"id\": \"a-creating-bytes-objects\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-creating-bytes-objects\",\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. Creating \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"bytes\"), \" Objects\"), mdx(\"p\", null, \"You can create \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" objects using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes()\"), \" constructor or by using literal notation with the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"b\"), \" prefix.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = bytes([0x48, 0x65, 0x6C, 0x6C, 0x6F])  # From a list of integers\\nprint(data)  # Output: b'Hello'\\n\\ndata = b\\\"Hello, World!\\\"  # Using literal notation\\nprint(data)  # Output: b'Hello, World!'\\n\")), mdx(\"h4\", {\n    \"id\": \"b-bytes-operations-and-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-bytes-operations-and-methods\",\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  }, \"bytes\"), \" Operations and Methods\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" objects support indexing, slicing, and various methods for manipulating and converting binary data.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = b\\\"Hello, World!\\\"\\nprint(data[0])  # Output: 72 (ASCII value of 'H')\\nprint(data[2:7])  # Output: b'llo, '\\nprint(data.decode())  # Output: 'Hello, World!' (convert to string)\\nprint(data.upper())  # Output: b'HELLO, WORLD!'\\nprint(data.replace(b\\\"Hello\\\", b\\\"Hi\\\"))  # Output: b'Hi, World!'\\n\")), mdx(\"h3\", {\n    \"id\": \"ii-bytearray\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#ii-bytearray\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"bytearray\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \" data type represents a mutable sequence of bytes. It is similar to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" but allows you to modify the byte values after creation.\"), mdx(\"h4\", {\n    \"id\": \"a-creating-bytearray-objects\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-creating-bytearray-objects\",\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. Creating \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"bytearray\"), \" Objects\"), mdx(\"p\", null, \"You can create \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \" objects using the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray()\"), \" constructor or by converting other binary data types like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" or strings.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = bytearray(b\\\"Hello\\\")\\nprint(data)  # Output: bytearray(b'Hello')\\n\\ndata = bytearray(\\\"Hello\\\", \\\"utf-8\\\")\\nprint(data)  # Output: bytearray(b'Hello')\\n\")), mdx(\"h4\", {\n    \"id\": \"b-bytearray-operations-and-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-bytearray-operations-and-methods\",\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  }, \"bytearray\"), \" Operations and Methods\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \" objects support indexing, slicing, and various methods for manipulating and converting binary data, similar to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" objects. Additionally, you can modify individual byte values using item assignment.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = bytearray(b\\\"Hello\\\")\\ndata[0] = ord(\\\"J\\\")  # Replace 'H' with 'J'\\nprint(data)  # Output: bytearray(b'Jello')\\n\\ndata.append(ord(\\\"!\\\"))  # Append a byte\\nprint(data)  # Output: bytearray(b'Jello!')\\n\\ndata.extend(b\\\", World\\\")  # Extend with bytes\\nprint(data)  # Output: bytearray(b'Jello!, World')\\n\\nprint(data.decode())  # Output: 'Jello!, World'\\n\")), mdx(\"h3\", {\n    \"id\": \"iii-memoryview\"\n  }, mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#iii-memoryview\",\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. \", mdx(\"inlineCode\", {\n    parentName: \"h3\"\n  }, \"memoryview\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \" data type provides a way to access and manipulate the internal data of other binary data types like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \" without creating a copy. It is used for low-level operations and can improve performance when working with large binary data.\"), mdx(\"h4\", {\n    \"id\": \"a-creating-memoryview-objects\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-creating-memoryview-objects\",\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. Creating \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"memoryview\"), \" Objects\"), mdx(\"p\", null, \"You can create \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \" objects by passing a \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytes\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"bytearray\"), \" object to the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview()\"), \" constructor.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = b\\\"Hello, World!\\\"\\nview = memoryview(data)\\nprint(view)  # Output: <memory at 0x7f8e9c4b8b48>\\n\")), mdx(\"h4\", {\n    \"id\": \"b-memoryview-operations-and-methods\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#b-memoryview-operations-and-methods\",\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  }, \"memoryview\"), \" Operations and Methods\"), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \" objects support indexing, slicing, and various methods for manipulating binary data. You can also modify the underlying bytes or bytearrays through the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \".\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"data = bytearray(b\\\"Hello\\\")\\nview = memoryview(data)\\nprint(view)  # Output: <memory at 0x7f8e9c4b8b48>\\n\\nview[0] = ord(\\\"J\\\")  # Modify the underlying bytearray\\nprint(data)  # Output: bytearray(b'Jello')\\n\\nview[1:4] = b\\\"xyz\\\"  # Modify a slice\\nprint(data)  # Output: bytearray(b'Jxyzo')\\n\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"memoryview\"), \" objects can also be used with other binary data types like \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"array\"), \" from the \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"array\"), \" module, providing a uniform way to access and manipulate binary data across different data structures.\"), mdx(\"h2\", {\n    \"id\": \"8-none-type-nonetype\"\n  }, mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#8-none-type-nonetype\",\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  }))), \"8. None Type: \", mdx(\"inlineCode\", {\n    parentName: \"h2\"\n  }, \"NoneType\")), mdx(\"p\", null, \"The \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"NoneType\"), \" data type in Python has only one possible value: \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"None\"), \". It is used to represent the absence of a value or a null value.\"), mdx(\"h4\", {\n    \"id\": \"a-using-none\"\n  }, mdx(\"a\", {\n    parentName: \"h4\",\n    \"href\": \"#a-using-none\",\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. Using \", mdx(\"inlineCode\", {\n    parentName: \"h4\"\n  }, \"None\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"None\"), \" is often used as a default value, a placeholder for optional arguments, or to indicate the absence of a meaningful value.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"x = None\\nif x is None:\\n    print(\\\"x has no value\\\")  # Output: x has no value\\n\\ndef my_function(arg=None):\\n    if arg is None:\\n        print(\\\"No argument provided.\\\")\\n    else:\\n        print(f\\\"The argument is: {arg}\\\")\\n\\nmy_function()  # Output: No argument provided.\\nmy_function(42)  # Output: The argument is: 42\\n\")), mdx(\"p\", null, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"None\"), \" is also returned by certain operations or functions when there is no meaningful value to return.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-python\"\n  }, \"print(None == 0)  # Output: False\\nprint(None is None)  # Output: True\\n\")), mdx(\"p\", null, \"While \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"None\"), \" evaluates to \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \" in boolean contexts, it is not the same as \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \". \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"None\"), \" is a distinct value representing the absence of a value, whereas \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"False\"), \" is a boolean value representing logical falsity.\"), mdx(\"hr\", null), mdx(\"p\", null, \"We have covered the various data structures available in Python, their characteristics, and the operations and methods that can be performed on each data type. Understanding these data structures and their use cases is crucial for writing efficient and readable Python code. By mastering these concepts, you'll be well-equipped to handle and manipulate data effectively in your Python programs.\"));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{"items":[{"url":"#data-structures","title":"Data Structures","items":[{"url":"#1-text-type-str","title":"1. Text Type: str","items":[{"url":"#i-operations-and-methods","title":"i. Operations and Methods","items":[{"url":"#a-string-indexing-and-slicing","title":"a. String Indexing and Slicing"},{"url":"#b-string-concatenation","title":"b. String Concatenation"},{"url":"#c-string-methods","title":"c. String Methods"},{"url":"#d-string-formatting","title":"d. String Formatting"}]}]},{"url":"#2-numeric-types","title":"2. Numeric Types","items":[{"url":"#i-int-integer","title":"i. int (Integer)","items":[{"url":"#a-integer-operations","title":"a. Integer Operations"},{"url":"#b-integer-methods","title":"b. Integer Methods"}]},{"url":"#ii-float-floating-point-number","title":"ii. float (Floating-Point Number)","items":[{"url":"#a-float-operations","title":"a. Float Operations"},{"url":"#b-float-methods","title":"b. Float Methods"}]},{"url":"#iii-complex-complex-number","title":"iii. complex (Complex Number)","items":[{"url":"#a-complex-operations","title":"a. Complex Operations"}]}]},{"url":"#3-sequence-types","title":"3. Sequence Types","items":[{"url":"#i-list","title":"i. list","items":[{"url":"#a-list-operations","title":"a. List Operations"},{"url":"#b-list-methods","title":"b. List Methods"}]},{"url":"#ii-tuple","title":"ii. tuple","items":[{"url":"#a-tuple-operations","title":"a. Tuple Operations"},{"url":"#b-tuple-methods","title":"b. Tuple Methods"}]},{"url":"#iii-range","title":"iii. range","items":[{"url":"#a-creating-a-range","title":"a. Creating a range"},{"url":"#b-range-operations","title":"b. range Operations"}]}]},{"url":"#4-mapping-type-dict","title":"4. Mapping Type: dict","items":[{"items":[{"url":"#a-dictionary-operations","title":"a. Dictionary Operations"},{"url":"#b-dictionary-methods","title":"b. Dictionary Methods"}]}]},{"url":"#5-set-types","title":"5. Set Types","items":[{"url":"#i-set","title":"i. set","items":[{"url":"#a-set-operations","title":"a. Set Operations"},{"url":"#b-set-methods","title":"b. Set Methods"}]},{"url":"#ii-frozenset","title":"ii. frozenset","items":[{"url":"#a-creating-a-frozenset","title":"a. Creating a frozenset"},{"url":"#b-frozenset-operations-and-methods","title":"b. frozenset Operations and Methods"}]}]},{"url":"#6-boolean-type-bool","title":"6. Boolean Type: bool","items":[{"items":[{"url":"#a-boolean-operations","title":"a. Boolean Operations"},{"url":"#b-truthiness","title":"b. Truthiness"}]}]},{"url":"#7-binary-types","title":"7. Binary Types","items":[{"url":"#i-bytes","title":"i. bytes","items":[{"url":"#a-creating-bytes-objects","title":"a. Creating bytes Objects"},{"url":"#b-bytes-operations-and-methods","title":"b. bytes Operations and Methods"}]},{"url":"#ii-bytearray","title":"ii. bytearray","items":[{"url":"#a-creating-bytearray-objects","title":"a. Creating bytearray Objects"},{"url":"#b-bytearray-operations-and-methods","title":"b. bytearray Operations and Methods"}]},{"url":"#iii-memoryview","title":"iii. memoryview","items":[{"url":"#a-creating-memoryview-objects","title":"a. Creating memoryview Objects"},{"url":"#b-memoryview-operations-and-methods","title":"b. memoryview Operations and Methods"}]}]},{"url":"#8-none-type-nonetype","title":"8. None Type: NoneType","items":[{"items":[{"url":"#a-using-none","title":"a. Using None"}]}]}]}]}}},"pageContext":{"id":"70fd8c79-6ec1-537a-b418-939a451f3471"}},"staticQueryHashes":["1022386572","1122327541","1339625561","2140385554","3442269102","3597609067"]}