{"id":42953,"date":"2025-07-29T09:49:22","date_gmt":"2025-07-29T00:49:22","guid":{"rendered":"https:\/\/techgym.jp\/?p=42953"},"modified":"2025-07-29T09:49:26","modified_gmt":"2025-07-29T00:49:26","slug":"operator-overloading","status":"publish","type":"post","link":"https:\/\/techgym.jp\/column\/operator-overloading\/","title":{"rendered":"\u3010Python\u5165\u9580\u3011\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u3092\u5b8c\u5168\u89e3\u8aac\uff01\u30ab\u30b9\u30bf\u30e0\u30af\u30e9\u30b9\u3067\u306e\u6f14\u7b97\u5b50\u5b9f\u88c5"},"content":{"rendered":"\n<p>\u00a0<\/p>\n<p>Python\u306e\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\uff08\u30de\u30b8\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\uff09\u306f\u3001\u72ec\u81ea\u306e\u30af\u30e9\u30b9\u3067\u6a19\u6e96\u7684\u306a\u6f14\u7b97\u5b50\uff08+\u3001-\u3001==\u306a\u3069\uff09\u3084\u7d44\u307f\u8fbc\u307f\u95a2\u6570\uff08len()\u3001str()\u306a\u3069\uff09\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u306e\u57fa\u672c\u304b\u3089\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067\u3001\u521d\u5fc3\u8005\u306e\u65b9\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h2>\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u306f\uff1f<\/h2>\n<p>\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u306f\u3001\u72ec\u81ea\u306e\u30af\u30e9\u30b9\u306b\u5bfe\u3057\u3066\u3001+\u3001-\u3001*\u3001==\u306a\u3069\u306e\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u4ed5\u7d44\u307f\u3067\u3059\u3002Python\u3067\u306f\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\uff08<code>__add__<\/code>\u3001<code>__sub__<\/code>\u306a\u3069\uff09\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u5b9f\u73fe\u3057\u307e\u3059\u3002<\/p>\n<h3>\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u306e\u7279\u5fb4<\/h3>\n<ul>\n<li><strong>\u524d\u5f8c\u306b\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a22\u500b<\/strong>: <code>__method__<\/code>\u306e\u5f62\u5f0f<\/li>\n<li><strong>Python\u304c\u81ea\u52d5\u7684\u306b\u547c\u3073\u51fa\u3057<\/strong>: \u6f14\u7b97\u5b50\u4f7f\u7528\u6642\u306b\u5185\u90e8\u3067\u5b9f\u884c<\/li>\n<li><strong>\u8c4a\u5bcc\u306a\u7a2e\u985e<\/strong>: \u7b97\u8853\u3001\u6bd4\u8f03\u3001\u8ad6\u7406\u3001\u578b\u5909\u63db\u306a\u3069\u69d8\u3005<\/li>\n<\/ul>\n<h2>\u57fa\u672c\u7684\u306a\u7b97\u8853\u6f14\u7b97\u5b50\u306e\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9<\/h2>\n<h3>1. \u57fa\u672c\u7684\u306a\u7b97\u8853\u6f14\u7b97\u5b50<\/h3>\n<pre><code class=\"language-python\">class Vector:\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n    \n    def __add__(self, other):\n        \"\"\"+ \u6f14\u7b97\u5b50\"\"\"\n        return Vector(self.x + other.x, self.y + other.y)\n    \n    def __sub__(self, other):\n        \"\"\"- \u6f14\u7b97\u5b50\"\"\"\n        return Vector(self.x - other.x, self.y - other.y)\n    \n    def __mul__(self, scalar):\n        \"\"\"* \u6f14\u7b97\u5b50\uff08\u30b9\u30ab\u30e9\u30fc\u500d\uff09\"\"\"\n        return Vector(self.x * scalar, self.y * scalar)\n    \n    def __str__(self):\n        return f\"Vector({self.x}, {self.y})\"\n\n# \u4f7f\u7528\u4f8b\nv1 = Vector(3, 4)\nv2 = Vector(1, 2)\n\nv3 = v1 + v2  # __add__ \u304c\u547c\u3070\u308c\u308b\nv4 = v1 - v2  # __sub__ \u304c\u547c\u3070\u308c\u308b\nv5 = v1 * 2   # __mul__ \u304c\u547c\u3070\u308c\u308b\n\nprint(v3)  # Vector(4, 6)\nprint(v4)  # Vector(2, 2)\nprint(v5)  # Vector(6, 8)\n<\/code><\/pre>\n<h3>2. \u5b8c\u5168\u306a\u7b97\u8853\u6f14\u7b97\u5b50\u30bb\u30c3\u30c8<\/h3>\n<pre><code class=\"language-python\">class Number:\n    def __init__(self, value):\n        self.value = value\n    \n    def __add__(self, other):\n        return Number(self.value + other.value)\n    \n    def __sub__(self, other):\n        return Number(self.value - other.value)\n    \n    def __mul__(self, other):\n        return Number(self.value * other.value)\n    \n    def __truediv__(self, other):\n        \"\"\"\/ \u6f14\u7b97\u5b50\uff08\u771f\u306e\u9664\u7b97\uff09\"\"\"\n        if other.value == 0:\n            raise ZeroDivisionError(\"\u30bc\u30ed\u3067\u5272\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\")\n        return Number(self.value \/ other.value)\n    \n    def __floordiv__(self, other):\n        \"\"\"\/\/ \u6f14\u7b97\u5b50\uff08\u5e8a\u9664\u7b97\uff09\"\"\"\n        return Number(self.value \/\/ other.value)\n    \n    def __mod__(self, other):\n        \"\"\"% \u6f14\u7b97\u5b50\uff08\u5270\u4f59\uff09\"\"\"\n        return Number(self.value % other.value)\n    \n    def __pow__(self, other):\n        \"\"\"** \u6f14\u7b97\u5b50\uff08\u3079\u304d\u4e57\uff09\"\"\"\n        return Number(self.value ** other.value)\n    \n    def __str__(self):\n        return f\"Number({self.value})\"\n\nn1 = Number(10)\nn2 = Number(3)\n\nprint(n1 + n2)   # Number(13)\nprint(n1 \/ n2)   # Number(3.333...)\nprint(n1 \/\/ n2)  # Number(3)\nprint(n1 % n2)   # Number(1)\nprint(n1 ** n2)  # Number(1000)\n<\/code><\/pre>\n<h2>\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9<\/h2>\n<h3>\u5b8c\u5168\u306a\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-python\">class Student:\n    def __init__(self, name, score):\n        self.name = name\n        self.score = score\n    \n    def __eq__(self, other):\n        \"\"\"== \u6f14\u7b97\u5b50\"\"\"\n        return self.score == other.score\n    \n    def __ne__(self, other):\n        \"\"\"!= \u6f14\u7b97\u5b50\"\"\"\n        return self.score != other.score\n    \n    def __lt__(self, other):\n        \"\"\"&lt; \u6f14\u7b97\u5b50\"\"\"\n        return self.score &lt; other.score\n    \n    def __le__(self, other):\n        \"\"\"&lt;= \u6f14\u7b97\u5b50\"\"\"\n        return self.score &lt;= other.score\n    \n    def __gt__(self, other):\n        \"\"\"&gt; \u6f14\u7b97\u5b50\"\"\"\n        return self.score &gt; other.score\n    \n    def __ge__(self, other):\n        \"\"\"&gt;= \u6f14\u7b97\u5b50\"\"\"\n        return self.score &gt;= other.score\n    \n    def __str__(self):\n        return f\"{self.name}({self.score}\u70b9)\"\n\n# \u4f7f\u7528\u4f8b\nstudent1 = Student(\"\u7530\u4e2d\", 85)\nstudent2 = Student(\"\u4f50\u85e4\", 92)\nstudent3 = Student(\"\u9234\u6728\", 85)\n\nprint(student1 == student3)  # True\uff08\u540c\u3058\u70b9\u6570\uff09\nprint(student1 &lt; student2)   # True\uff08\u7530\u4e2d &lt; \u4f50\u85e4\uff09\nprint(student2 &gt; student1)   # True\uff08\u4f50\u85e4 &gt; \u7530\u4e2d\uff09\n\n# \u30bd\u30fc\u30c8\u6a5f\u80fd\u3082\u81ea\u52d5\u7684\u306b\u4f7f\u7528\u53ef\u80fd\nstudents = [student1, student2, student3]\nstudents.sort()  # \u70b9\u6570\u9806\u306b\u30bd\u30fc\u30c8\nfor student in students:\n    print(student)\n<\/code><\/pre>\n<h2>\u5b9f\u8df5\u7684\u306a\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u4f8b<\/h2>\n<h3>1. \u5206\u6570\u30af\u30e9\u30b9<\/h3>\n<pre><code class=\"language-python\">from math import gcd\n\nclass Fraction:\n    def __init__(self, numerator, denominator=1):\n        if denominator == 0:\n            raise ValueError(\"\u5206\u6bcd\u306f0\u306b\u3067\u304d\u307e\u305b\u3093\")\n        \n        # \u7d04\u5206\n        common = gcd(abs(numerator), abs(denominator))\n        self.numerator = numerator \/\/ common\n        self.denominator = denominator \/\/ common\n        \n        # \u5206\u6bcd\u3092\u6b63\u6570\u306b\u3059\u308b\n        if self.denominator &lt; 0:\n            self.numerator = -self.numerator\n            self.denominator = -self.denominator\n    \n    def __add__(self, other):\n        \"\"\"\u5206\u6570\u306e\u52a0\u7b97\"\"\"\n        num = self.numerator * other.denominator + other.numerator * self.denominator\n        den = self.denominator * other.denominator\n        return Fraction(num, den)\n    \n    def __sub__(self, other):\n        \"\"\"\u5206\u6570\u306e\u6e1b\u7b97\"\"\"\n        num = self.numerator * other.denominator - other.numerator * self.denominator\n        den = self.denominator * other.denominator\n        return Fraction(num, den)\n    \n    def __mul__(self, other):\n        \"\"\"\u5206\u6570\u306e\u4e57\u7b97\"\"\"\n        num = self.numerator * other.numerator\n        den = self.denominator * other.denominator\n        return Fraction(num, den)\n    \n    def __truediv__(self, other):\n        \"\"\"\u5206\u6570\u306e\u9664\u7b97\"\"\"\n        if other.numerator == 0:\n            raise ZeroDivisionError(\"\u30bc\u30ed\u3067\u5272\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\")\n        num = self.numerator * other.denominator\n        den = self.denominator * other.numerator\n        return Fraction(num, den)\n    \n    def __eq__(self, other):\n        \"\"\"\u5206\u6570\u306e\u7b49\u4fa1\u6bd4\u8f03\"\"\"\n        return (self.numerator == other.numerator and \n                self.denominator == other.denominator)\n    \n    def __str__(self):\n        if self.denominator == 1:\n            return str(self.numerator)\n        return f\"{self.numerator}\/{self.denominator}\"\n    \n    def __float__(self):\n        \"\"\"float\u578b\u3078\u306e\u5909\u63db\"\"\"\n        return self.numerator \/ self.denominator\n\n# \u4f7f\u7528\u4f8b\nf1 = Fraction(1, 2)  # 1\/2\nf2 = Fraction(1, 3)  # 1\/3\nf3 = Fraction(2, 4)  # 2\/4 \u2192 1\/2 \u306b\u7d04\u5206\n\nprint(f1 + f2)   # 5\/6\nprint(f1 - f2)   # 1\/6\nprint(f1 * f2)   # 1\/6\nprint(f1 \/ f2)   # 3\/2\nprint(f1 == f3)  # True\uff08\u7d04\u5206\u5f8c\u3067\u540c\u3058\uff09\nprint(float(f1)) # 0.5\n<\/code><\/pre>\n<h3>2. \u884c\u5217\u30af\u30e9\u30b9<\/h3>\n<pre><code class=\"language-python\">class Matrix:\n    def __init__(self, data):\n        self.data = [row[:] for row in data]  # \u6df1\u3044\u30b3\u30d4\u30fc\n        self.rows = len(data)\n        self.cols = len(data[0]) if data else 0\n    \n    def __add__(self, other):\n        \"\"\"\u884c\u5217\u306e\u52a0\u7b97\"\"\"\n        if self.rows != other.rows or self.cols != other.cols:\n            raise ValueError(\"\u884c\u5217\u306e\u30b5\u30a4\u30ba\u304c\u7570\u306a\u308a\u307e\u3059\")\n        \n        result = []\n        for i in range(self.rows):\n            row = []\n            for j in range(self.cols):\n                row.append(self.data[i][j] + other.data[i][j])\n            result.append(row)\n        return Matrix(result)\n    \n    def __sub__(self, other):\n        \"\"\"\u884c\u5217\u306e\u6e1b\u7b97\"\"\"\n        if self.rows != other.rows or self.cols != other.cols:\n            raise ValueError(\"\u884c\u5217\u306e\u30b5\u30a4\u30ba\u304c\u7570\u306a\u308a\u307e\u3059\")\n        \n        result = []\n        for i in range(self.rows):\n            row = []\n            for j in range(self.cols):\n                row.append(self.data[i][j] - other.data[i][j])\n            result.append(row)\n        return Matrix(result)\n    \n    def __mul__(self, other):\n        \"\"\"\u884c\u5217\u306e\u4e57\u7b97\u307e\u305f\u306f\u30b9\u30ab\u30e9\u30fc\u500d\"\"\"\n        if isinstance(other, (int, float)):\n            # \u30b9\u30ab\u30e9\u30fc\u500d\n            result = []\n            for i in range(self.rows):\n                row = []\n                for j in range(self.cols):\n                    row.append(self.data[i][j] * other)\n                result.append(row)\n            return Matrix(result)\n        elif isinstance(other, Matrix):\n            # \u884c\u5217\u306e\u4e57\u7b97\n            if self.cols != other.rows:\n                raise ValueError(\"\u884c\u5217\u306e\u4e57\u7b97\u304c\u3067\u304d\u307e\u305b\u3093\")\n            \n            result = []\n            for i in range(self.rows):\n                row = []\n                for j in range(other.cols):\n                    sum_val = 0\n                    for k in range(self.cols):\n                        sum_val += self.data[i][k] * other.data[k][j]\n                    row.append(sum_val)\n                result.append(row)\n            return Matrix(result)\n    \n    def __str__(self):\n        lines = []\n        for row in self.data:\n            lines.append('[' + ', '.join(f'{x:4}' for x in row) + ']')\n        return '[\\n ' + '\\n '.join(lines) + '\\n]'\n\n# \u4f7f\u7528\u4f8b\nm1 = Matrix([[1, 2], [3, 4]])\nm2 = Matrix([[5, 6], [7, 8]])\n\nprint(\"m1 + m2:\")\nprint(m1 + m2)\n# [   6,    8]\n# [  10,   12]\n\nprint(\"m1 * 2:\")\nprint(m1 * 2)\n# [   2,    4]\n# [   6,    8]\n<\/code><\/pre>\n<h3>3. \u91d1\u984d\u30af\u30e9\u30b9<\/h3>\n<pre><code class=\"language-python\">class Money:\n    def __init__(self, amount, currency=\"JPY\"):\n        self.amount = amount\n        self.currency = currency\n    \n    def __add__(self, other):\n        \"\"\"\u91d1\u984d\u306e\u52a0\u7b97\"\"\"\n        if self.currency != other.currency:\n            raise ValueError(f\"\u7570\u306a\u308b\u901a\u8ca8\u540c\u58eb\u306f\u8a08\u7b97\u3067\u304d\u307e\u305b\u3093: {self.currency} vs {other.currency}\")\n        return Money(self.amount + other.amount, self.currency)\n    \n    def __sub__(self, other):\n        \"\"\"\u91d1\u984d\u306e\u6e1b\u7b97\"\"\"\n        if self.currency != other.currency:\n            raise ValueError(f\"\u7570\u306a\u308b\u901a\u8ca8\u540c\u58eb\u306f\u8a08\u7b97\u3067\u304d\u307e\u305b\u3093: {self.currency} vs {other.currency}\")\n        return Money(self.amount - other.amount, self.currency)\n    \n    def __mul__(self, multiplier):\n        \"\"\"\u91d1\u984d\u306e\u4e57\u7b97\uff08\u6570\u91cf\u3068\u306e\u639b\u3051\u7b97\uff09\"\"\"\n        if not isinstance(multiplier, (int, float)):\n            raise TypeError(\"\u91d1\u984d\u306f\u6570\u5024\u3068\u306e\u307f\u4e57\u7b97\u3067\u304d\u307e\u3059\")\n        return Money(self.amount * multiplier, self.currency)\n    \n    def __truediv__(self, divisor):\n        \"\"\"\u91d1\u984d\u306e\u9664\u7b97\"\"\"\n        if not isinstance(divisor, (int, float)):\n            raise TypeError(\"\u91d1\u984d\u306f\u6570\u5024\u3067\u306e\u307f\u9664\u7b97\u3067\u304d\u307e\u3059\")\n        if divisor == 0:\n            raise ZeroDivisionError(\"\u30bc\u30ed\u3067\u5272\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\")\n        return Money(self.amount \/ divisor, self.currency)\n    \n    def __eq__(self, other):\n        \"\"\"\u91d1\u984d\u306e\u7b49\u4fa1\u6bd4\u8f03\"\"\"\n        return (self.amount == other.amount and \n                self.currency == other.currency)\n    \n    def __lt__(self, other):\n        \"\"\"\u91d1\u984d\u306e\u5927\u5c0f\u6bd4\u8f03\"\"\"\n        if self.currency != other.currency:\n            raise ValueError(\"\u7570\u306a\u308b\u901a\u8ca8\u540c\u58eb\u306f\u6bd4\u8f03\u3067\u304d\u307e\u305b\u3093\")\n        return self.amount &lt; other.amount\n    \n    def __str__(self):\n        return f\"{self.amount:,.0f} {self.currency}\"\n\n# \u4f7f\u7528\u4f8b\nprice1 = Money(1000, \"JPY\")\nprice2 = Money(500, \"JPY\")\ntax_rate = 1.1\n\ntotal = price1 + price2\nprint(total)  # 1,500 JPY\n\ntotal_with_tax = total * tax_rate\nprint(total_with_tax)  # 1,650 JPY\n\nprint(price1 &gt; price2)  # True\n<\/code><\/pre>\n<h2>\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u306e\u7a2e\u985e\u3068\u4f7f\u3044\u65b9<\/h2>\n<h3>1. \u6587\u5b57\u5217\u8868\u73fe\u30e1\u30bd\u30c3\u30c9<\/h3>\n<pre><code class=\"language-python\">class Book:\n    def __init__(self, title, author, pages):\n        self.title = title\n        self.author = author\n        self.pages = pages\n    \n    def __str__(self):\n        \"\"\"\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306e\u6587\u5b57\u5217\u8868\u73fe\"\"\"\n        return f\"\u300e{self.title}\u300f- {self.author}\"\n    \n    def __repr__(self):\n        \"\"\"\u958b\u767a\u8005\u5411\u3051\u306e\u6587\u5b57\u5217\u8868\u73fe\"\"\"\n        return f\"Book('{self.title}', '{self.author}', {self.pages})\"\n    \n    def __len__(self):\n        \"\"\"len()\u95a2\u6570\u3067\u547c\u3070\u308c\u308b\"\"\"\n        return self.pages\n\nbook = Book(\"Python\u5165\u9580\", \"\u5c71\u7530\u592a\u90ce\", 300)\n\nprint(str(book))   # \u300ePython\u5165\u9580\u300f- \u5c71\u7530\u592a\u90ce\nprint(repr(book))  # Book('Python\u5165\u9580', '\u5c71\u7530\u592a\u90ce', 300)\nprint(len(book))   # 300\n<\/code><\/pre>\n<h3>2. \u30b3\u30f3\u30c6\u30ca\u64cd\u4f5c\u30e1\u30bd\u30c3\u30c9<\/h3>\n<pre><code class=\"language-python\">class CustomList:\n    def __init__(self, items=None):\n        self.items = items or []\n    \n    def __len__(self):\n        \"\"\"len()\u95a2\u6570\"\"\"\n        return len(self.items)\n    \n    def __getitem__(self, index):\n        \"\"\"list[index] \u3067\u306e\u30a2\u30af\u30bb\u30b9\"\"\"\n        return self.items[index]\n    \n    def __setitem__(self, index, value):\n        \"\"\"list[index] = value \u3067\u306e\u8a2d\u5b9a\"\"\"\n        self.items[index] = value\n    \n    def __contains__(self, item):\n        \"\"\"in \u6f14\u7b97\u5b50\"\"\"\n        return item in self.items\n    \n    def __iter__(self):\n        \"\"\"for\u6587\u3067\u306e\u53cd\u5fa9\"\"\"\n        return iter(self.items)\n    \n    def __str__(self):\n        return f\"CustomList({self.items})\"\n\n# \u4f7f\u7528\u4f8b\nmy_list = CustomList([1, 2, 3, 4, 5])\n\nprint(len(my_list))     # 5\nprint(my_list[2])       # 3\nmy_list[2] = 30\nprint(my_list[2])       # 30\nprint(3 in my_list)     # False\uff0830\u306b\u5909\u66f4\u3055\u308c\u305f\u305f\u3081\uff09\nprint(30 in my_list)    # True\n\n# for\u6587\u3067\u53cd\u5fa9\u53ef\u80fd\nfor item in my_list:\n    print(item, end=' ')  # 1 2 30 4 5\n<\/code><\/pre>\n<h3>3. \u578b\u5909\u63db\u30e1\u30bd\u30c3\u30c9<\/h3>\n<pre><code class=\"language-python\">class Temperature:\n    def __init__(self, celsius):\n        self.celsius = celsius\n    \n    def __int__(self):\n        \"\"\"int()\u95a2\u6570\u3067\u306e\u5909\u63db\"\"\"\n        return int(self.celsius)\n    \n    def __float__(self):\n        \"\"\"float()\u95a2\u6570\u3067\u306e\u5909\u63db\"\"\"\n        return float(self.celsius)\n    \n    def __bool__(self):\n        \"\"\"bool()\u95a2\u6570\u3067\u306e\u5909\u63db\uff08\u7d76\u5bfe\u96f6\u5ea6\u3088\u308a\u9ad8\u3044\u304b\u3069\u3046\u304b\uff09\"\"\"\n        return self.celsius &gt; -273.15\n    \n    def __str__(self):\n        return f\"{self.celsius}\u00b0C\"\n\ntemp = Temperature(25.5)\n\nprint(int(temp))    # 25\nprint(float(temp))  # 25.5\nprint(bool(temp))   # True\n\n# \u6761\u4ef6\u5224\u5b9a\u3067\u3082\u4f7f\u7528\u53ef\u80fd\nif temp:\n    print(\"\u7d76\u5bfe\u96f6\u5ea6\u3088\u308a\u9ad8\u3044\u6e29\u5ea6\u3067\u3059\")\n<\/code><\/pre>\n<h2>\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u4e00\u89a7\u8868<\/h2>\n<h3>\u7b97\u8853\u6f14\u7b97\u5b50<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6f14\u7b97\u5b50<\/th>\n<th>\u30e1\u30bd\u30c3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>+<\/td>\n<td><code>__add__<\/code><\/td>\n<td>\u52a0\u7b97<\/td>\n<\/tr>\n<tr>\n<td>&#8211;<\/td>\n<td><code>__sub__<\/code><\/td>\n<td>\u6e1b\u7b97<\/td>\n<\/tr>\n<tr>\n<td>*<\/td>\n<td><code>__mul__<\/code><\/td>\n<td>\u4e57\u7b97<\/td>\n<\/tr>\n<tr>\n<td>\/<\/td>\n<td><code>__truediv__<\/code><\/td>\n<td>\u771f\u306e\u9664\u7b97<\/td>\n<\/tr>\n<tr>\n<td>\/\/<\/td>\n<td><code>__floordiv__<\/code><\/td>\n<td>\u5e8a\u9664\u7b97<\/td>\n<\/tr>\n<tr>\n<td>%<\/td>\n<td><code>__mod__<\/code><\/td>\n<td>\u5270\u4f59<\/td>\n<\/tr>\n<tr>\n<td>**<\/td>\n<td><code>__pow__<\/code><\/td>\n<td>\u3079\u304d\u4e57<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u6bd4\u8f03\u6f14\u7b97\u5b50<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6f14\u7b97\u5b50<\/th>\n<th>\u30e1\u30bd\u30c3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>==<\/td>\n<td><code>__eq__<\/code><\/td>\n<td>\u7b49\u4fa1<\/td>\n<\/tr>\n<tr>\n<td>!=<\/td>\n<td><code>__ne__<\/code><\/td>\n<td>\u975e\u7b49\u4fa1<\/td>\n<\/tr>\n<tr>\n<td>&lt;<\/td>\n<td><code>__lt__<\/code><\/td>\n<td>\u672a\u6e80<\/td>\n<\/tr>\n<tr>\n<td>&lt;=<\/td>\n<td><code>__le__<\/code><\/td>\n<td>\u4ee5\u4e0b<\/td>\n<\/tr>\n<tr>\n<td>&gt;<\/td>\n<td><code>__gt__<\/code><\/td>\n<td>\u8d85\u904e<\/td>\n<\/tr>\n<tr>\n<td>&gt;=<\/td>\n<td><code>__ge__<\/code><\/td>\n<td>\u4ee5\u4e0a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u305d\u306e\u4ed6\u306e\u91cd\u8981\u306a\u30e1\u30bd\u30c3\u30c9<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u95a2\u6570\/\u6f14\u7b97\u5b50<\/th>\n<th>\u30e1\u30bd\u30c3\u30c9<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>str()<\/td>\n<td><code>__str__<\/code><\/td>\n<td>\u6587\u5b57\u5217\u8868\u73fe<\/td>\n<\/tr>\n<tr>\n<td>repr()<\/td>\n<td><code>__repr__<\/code><\/td>\n<td>\u958b\u767a\u8005\u5411\u3051\u8868\u73fe<\/td>\n<\/tr>\n<tr>\n<td>len()<\/td>\n<td><code>__len__<\/code><\/td>\n<td>\u9577\u3055<\/td>\n<\/tr>\n<tr>\n<td>bool()<\/td>\n<td><code>__bool__<\/code><\/td>\n<td>\u771f\u507d\u5024\u5909\u63db<\/td>\n<\/tr>\n<tr>\n<td>int()<\/td>\n<td><code>__int__<\/code><\/td>\n<td>\u6574\u6570\u5909\u63db<\/td>\n<\/tr>\n<tr>\n<td>float()<\/td>\n<td><code>__float__<\/code><\/td>\n<td>\u6d6e\u52d5\u5c0f\u6570\u70b9\u5909\u63db<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u3088\u304f\u3042\u308b\u9593\u9055\u3044\u3068\u6ce8\u610f\u70b9<\/h2>\n<h3>1. \u5bfe\u79f0\u6027\u306e\u6b20\u5982<\/h3>\n<pre><code class=\"language-python\"># \u274c \u554f\u984c\u306e\u3042\u308b\u5b9f\u88c5\nclass Number:\n    def __init__(self, value):\n        self.value = value\n    \n    def __add__(self, other):\n        return Number(self.value + other.value)\n\nn = Number(5)\n# n + 3  # AttributeError: 'int' has no attribute 'value'\n\n# \u2705 \u6539\u5584\u3055\u308c\u305f\u5b9f\u88c5\nclass Number:\n    def __init__(self, value):\n        self.value = value\n    \n    def __add__(self, other):\n        if isinstance(other, Number):\n            return Number(self.value + other.value)\n        return Number(self.value + other)\n    \n    def __radd__(self, other):\n        \"\"\"\u53f3\u304b\u3089\u52a0\u7b97\u3055\u308c\u308b\u5834\u5408\"\"\"\n        return Number(other + self.value)\n<\/code><\/pre>\n<h3>2. \u623b\u308a\u5024\u306e\u578b\u306e\u4e00\u8cab\u6027<\/h3>\n<pre><code class=\"language-python\"># \u274c \u4e00\u8cab\u6027\u306e\u306a\u3044\u623b\u308a\u5024\nclass Vector:\n    def __add__(self, other):\n        return [self.x + other.x, self.y + other.y]  # \u30ea\u30b9\u30c8\u3092\u8fd4\u3059\n\n# \u2705 \u4e00\u8cab\u3057\u305f\u623b\u308a\u5024\nclass Vector:\n    def __add__(self, other):\n        return Vector(self.x + other.x, self.y + other.y)  # \u540c\u3058\u578b\u3092\u8fd4\u3059\n<\/code><\/pre>\n<h3>3. \u4e0d\u5909\u6027\u306e\u8003\u616e<\/h3>\n<pre><code class=\"language-python\"># \u2705 \u4e0d\u5909\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u5b9f\u88c5\nclass ImmutablePoint:\n    def __init__(self, x, y):\n        self._x = x\n        self._y = y\n    \n    @property\n    def x(self):\n        return self._x\n    \n    @property\n    def y(self):\n        return self._y\n    \n    def __add__(self, other):\n        return ImmutablePoint(self.x + other.x, self.y + other.y)\n<\/code><\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Python \u306e\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u72ec\u81ea\u306e\u30af\u30e9\u30b9\u3092\u7d44\u307f\u8fbc\u307f\u578b\u306e\u3088\u3046\u306b\u81ea\u7136\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u3059\u3002\u9069\u5207\u306b\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u76f4\u611f\u7684\u3067\u4f7f\u3044\u3084\u3059\u3044API\u3092\u63d0\u4f9b\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8<\/h3>\n<ul>\n<li><strong>\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\u3067\u6f14\u7b97\u5b50\u306e\u52d5\u4f5c\u3092\u5b9a\u7fa9<\/strong><\/li>\n<li><strong>\u4e00\u8cab\u6027\u306e\u3042\u308b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u63d0\u4f9b<\/strong><\/li>\n<li><strong>\u578b\u306e\u5bfe\u79f0\u6027\u3068\u4e0d\u5909\u6027\u3092\u8003\u616e<\/strong><\/li>\n<li><strong>\u9069\u5207\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u5b9f\u88c5<\/strong><\/li>\n<li><strong>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u5316\u3067\u30e1\u30bd\u30c3\u30c9\u306e\u52d5\u4f5c\u3092\u660e\u78ba\u5316<\/strong><\/li>\n<\/ul>\n<p>\u307e\u305a\u306f\u57fa\u672c\u7684\u306a\u7b97\u8853\u6f14\u7b97\u5b50\u304b\u3089\u59cb\u3081\u3066\u3001\u5f90\u3005\u306b\u8907\u96d1\u306a\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u3087\u3046\u3002\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u7df4\u7fd2\u3059\u308b\u3053\u3068\u3067\u3001\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u306e\u6982\u5ff5\u304c\u3057\u3063\u304b\u308a\u3068\u8eab\u306b\u4ed8\u304d\u307e\u3059\uff01<\/p>\n\n\n\n<p>\u25a0\u30d7\u30ed\u30f3\u30d7\u30c8\u3060\u3051\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30a2\u30d7\u30ea\u3092\u958b\u767a\u30fb\u516c\u958b\u3057\u3066\u307f\u305f\uff01\uff01<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"o8tyhJAxTQ\"><a href=\"https:\/\/techgym.jp\/column\/ori-app\/\">\u30d7\u30ed\u30f3\u30d7\u30c8\u3060\u3051\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30a2\u30d7\u30ea\u3092\u958b\u767a\u30fb\u516c\u958b\u3057\u3066\u307f\u305f\uff01\uff01<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u30d7\u30ed\u30f3\u30d7\u30c8\u3060\u3051\u3067\u30aa\u30ea\u30b8\u30ca\u30eb\u30a2\u30d7\u30ea\u3092\u958b\u767a\u30fb\u516c\u958b\u3057\u3066\u307f\u305f\uff01\uff01&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/column\/ori-app\/embed\/#?secret=H2VnJPsNmj#?secret=o8tyhJAxTQ\" data-secret=\"o8tyhJAxTQ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u25a0AI\u6642\u4ee3\u306e\u7b2c\u4e00\u6b69\uff01\u300cAI\u99c6\u52d5\u958b\u767a\u30b3\u30fc\u30b9\u300d\u306f\u3058\u3081\u307e\u3057\u305f\uff01<\/p>\n\n\n\n<p>\u30c6\u30c3\u30af\u30b8\u30e0\u6771\u4eac\u672c\u6821\u3067\u5148\u884c\u958b\u59cb\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"9j4fNmhbhZ\"><a href=\"https:\/\/techgym.jp\/about\/ai-driven-development\/\">AI\u6642\u4ee3\u306e\u7b2c\u4e00\u6b69\uff01\u300cAI\u99c6\u52d5\u958b\u767a\u30b3\u30fc\u30b9\u300d\uff08\u521d\u5fc3\u8005\u5411\u3051\uff09<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;AI\u6642\u4ee3\u306e\u7b2c\u4e00\u6b69\uff01\u300cAI\u99c6\u52d5\u958b\u767a\u30b3\u30fc\u30b9\u300d\uff08\u521d\u5fc3\u8005\u5411\u3051\uff09&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/about\/ai-driven-development\/embed\/#?secret=jLA08lPaeD#?secret=9j4fNmhbhZ\" data-secret=\"9j4fNmhbhZ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u25a0\u30c6\u30c3\u30af\u30b8\u30e0\u6771\u4eac\u672c\u6821<\/p>\n\n\n\n<p>\u300c\u6b66\u7530\u587e\u300d\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u7248\u3068\u3044\u3048\u3070\u300c\u30c6\u30c3\u30af\u30b8\u30e0\u300d\u3002<br>\u8b1b\u7fa9\u52d5\u753b\u306a\u3057\u3001\u6559\u79d1\u66f8\u306a\u3057\u3002\u300c\u9032\u6357\u7ba1\u7406\u3068\u30b3\u30fc\u30c1\u30f3\u30b0\u300d\u3067\u52b9\u7387\u5b66\u7fd2\u3002<br>\u3088\u308a\u65e9\u304f\u3001\u3088\u308a\u5b89\u304f\u3001\u3057\u304b\u3082\u5bfe\u9762\u578b\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"qDKhwNtDAr\"><a href=\"https:\/\/techgym.jp\/tokyo\/tokyo_honko\/\">\u30c6\u30c3\u30af\u30b8\u30e0\u6771\u4eac\u672c\u6821<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u30c6\u30c3\u30af\u30b8\u30e0\u6771\u4eac\u672c\u6821&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/tokyo\/tokyo_honko\/embed\/#?secret=3LvZueN3Ra#?secret=qDKhwNtDAr\" data-secret=\"qDKhwNtDAr\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\uff1c\u77ed\u671f\u8b1b\u7fd2\uff1e5\u65e5\u30675\u4e07\u5186\u306e\u300cPython\u30df\u30cb\u30ad\u30e3\u30f3\u30d7\u300d\u958b\u50ac\u4e2d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"fDGh31JN6U\"><a href=\"https:\/\/techgym.jp\/event\/nagatacho_camp\/\">\u72ec\u5b66\u3082\u30aa\u30f3\u30e9\u30a4\u30f3\u3082\u7121\u7406\u3060\u304b\u3089\u3001\u6709\u7d66\u3068\u3063\u3066\u300cPython\u30df\u30cb\u30ad\u30e3\u30f3\u30d7\u300d\u3078\u30105\u65e5\u9593\u30675\u4e07\u5186\u3011<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u72ec\u5b66\u3082\u30aa\u30f3\u30e9\u30a4\u30f3\u3082\u7121\u7406\u3060\u304b\u3089\u3001\u6709\u7d66\u3068\u3063\u3066\u300cPython\u30df\u30cb\u30ad\u30e3\u30f3\u30d7\u300d\u3078\u30105\u65e5\u9593\u30675\u4e07\u5186\u3011&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/event\/nagatacho_camp\/embed\/#?secret=S0mzO9UBPs#?secret=fDGh31JN6U\" data-secret=\"fDGh31JN6U\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\uff1c\u67081\u958b\u50ac\uff1e\u653e\u9001\u4f5c\u5bb6\u306b\u3088\u308b\u6620\u50cf\u30c7\u30a3\u30ec\u30af\u30bf\u30fc\u990a\u6210\u8b1b\u5ea7<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"yHqQObVxjm\"><a href=\"https:\/\/techgym.jp\/event\/video_director\/\">\u73fe\u5f79\u653e\u9001\u4f5c\u5bb6\u304c\u6559\u3048\u308b\u52d5\u753b\u8b1b\u5ea7\uff01\u300e\uff24\uff2f\uff27\uff21\u300f<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u73fe\u5f79\u653e\u9001\u4f5c\u5bb6\u304c\u6559\u3048\u308b\u52d5\u753b\u8b1b\u5ea7\uff01\u300e\uff24\uff2f\uff27\uff21\u300f&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/event\/video_director\/embed\/#?secret=7r3qek2qMQ#?secret=yHqQObVxjm\" data-secret=\"yHqQObVxjm\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\uff1c\u30aa\u30f3\u30e9\u30a4\u30f3\u7121\u6599\uff1e\u30bc\u30ed\u304b\u3089\u59cb\u3081\u308bPython\u7206\u901f\u8b1b\u5ea7<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"lpOVs5fLfD\"><a href=\"https:\/\/techgym.jp\/tokyo_python\/\">\u30bc\u30ed\u304b\u3089\u59cb\u3081\u308bPython\u7206\u901f\u8b1b\u5ea7\uff08\u7406\u7cfb\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u5411\u3051\uff09<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u30bc\u30ed\u304b\u3089\u59cb\u3081\u308bPython\u7206\u901f\u8b1b\u5ea7\uff08\u7406\u7cfb\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u5411\u3051\uff09&#8221; &#8212; \u3010\u30c6\u30c3\u30af\u30b8\u30e0\u3011\u683c\u5b89\u30fb\u5bfe\u9762\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\" src=\"https:\/\/techgym.jp\/tokyo_python\/embed\/#?secret=ohUMDRBVVs#?secret=lpOVs5fLfD\" data-secret=\"lpOVs5fLfD\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 Python\u306e\u6f14\u7b97\u5b50\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3068\u7279\u6b8a\u30e1\u30bd\u30c3\u30c9\uff08\u30de\u30b8\u30c3\u30af\u30e1\u30bd\u30c3\u30c9\uff09\u306f\u3001\u72ec\u81ea\u306e\u30af\u30e9\u30b9\u3067\u6a19\u6e96\u7684\u306a\u6f14\u7b97\u5b50\uff08+\u3001-\u3001==\u306a\u3069\uff09\u3084\u7d44\u307f\u8fbc\u307f\u95a2\u6570\uff08len()\u3001str()\u306a\u3069\uff09\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u6f14\u7b97 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":42501,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-42953","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-column"],"views":72,"jetpack_featured_media_url":"\/wp-content\/uploads\/2025\/07\/f3403acf5c65aedec0dba821c4c26404.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/posts\/42953","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/comments?post=42953"}],"version-history":[{"count":0,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/posts\/42953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/media\/42501"}],"wp:attachment":[{"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/media?parent=42953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/categories?post=42953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/tags?post=42953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}