{"id":43001,"date":"2025-07-29T17:33:44","date_gmt":"2025-07-29T08:33:44","guid":{"rendered":"https:\/\/techgym.jp\/?p=43001"},"modified":"2025-07-29T17:33:48","modified_gmt":"2025-07-29T08:33:48","slug":"python-format","status":"publish","type":"post","link":"https:\/\/techgym.jp\/column\/python-format\/","title":{"rendered":"Python format()\u5b8c\u5168\u30ac\u30a4\u30c9 &#8211; \u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067"},"content":{"rendered":"\n<p>\u00a0<\/p>\n<p>Python\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u3001\u52d5\u7684\u306a\u6587\u5b57\u5217\u751f\u6210\u306b\u304a\u3044\u3066\u6b20\u304b\u305b\u306a\u3044\u6a5f\u80fd\u3067\u3059\u3002<code>format()<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u53e4\u3044<code>%<\/code>\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u4ee3\u308f\u308b\u67d4\u8edf\u3067\u5f37\u529b\u306a\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u624b\u6cd5\u3068\u3057\u3066\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<code>format()<\/code>\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u304b\u3089\u9ad8\u5ea6\u306a\u4f7f\u7528\u6cd5\u307e\u3067\u3001\u5b9f\u8df5\u7684\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u3068\u3082\u306b\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<h2>format()\u30e1\u30bd\u30c3\u30c9\u3068\u306f<\/h2>\n<p><code>format()<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u3001Python 2.6\u3067\u5c0e\u5165\u3055\u308c\u305f\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u6a5f\u80fd\u3067\u3001\u6587\u5b57\u5217\u5185\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc<code>{}<\/code>\u306b\u5024\u3092\u57cb\u3081\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5f93\u6765\u306e<code>%<\/code>\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3088\u308a\u3082\u8aad\u307f\u3084\u3059\u304f\u3001\u3088\u308a\u591a\u304f\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<h3>\u57fa\u672c\u69cb\u6587<\/h3>\n<pre><code class=\"language-python\">\"\u6587\u5b57\u5217{\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc}\".format(\u5024)\n<\/code><\/pre>\n<h2>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h2>\n<h3>1. \u5358\u7d14\u306a\u5024\u306e\u57cb\u3081\u8fbc\u307f<\/h3>\n<pre><code class=\"language-python\">name = \"\u592a\u90ce\"\nmessage = \"\u3053\u3093\u306b\u3061\u306f\u3001{}\u3055\u3093\uff01\".format(name)\nprint(message)  # \u3053\u3093\u306b\u3061\u306f\u3001\u592a\u90ce\u3055\u3093\uff01\n<\/code><\/pre>\n<h3>2. \u8907\u6570\u306e\u5024\u306e\u57cb\u3081\u8fbc\u307f<\/h3>\n<pre><code class=\"language-python\">name = \"\u592a\u90ce\"\nage = 25\nmessage = \"{}\u3055\u3093\u306f{}\u6b73\u3067\u3059\".format(name, age)\nprint(message)  # \u592a\u90ce\u3055\u3093\u306f25\u6b73\u3067\u3059\n<\/code><\/pre>\n<h3>3. \u4f4d\u7f6e\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">text = \"{1}\u3068{0}\u3068{1}\".format(\"\u308a\u3093\u3054\", \"\u307f\u304b\u3093\")\nprint(text)  # \u307f\u304b\u3093\u3068\u308a\u3093\u3054\u3068\u307f\u304b\u3093\n<\/code><\/pre>\n<h2>\u540d\u524d\u4ed8\u304d\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc<\/h2>\n<h3>\u30ad\u30fc\u30ef\u30fc\u30c9\u5f15\u6570\u306e\u4f7f\u7528<\/h3>\n<pre><code class=\"language-python\">message = \"{name}\u3055\u3093\u306e\u5e74\u9f62\u306f{age}\u6b73\u3067\u3059\".format(name=\"\u82b1\u5b50\", age=30)\nprint(message)  # \u82b1\u5b50\u3055\u3093\u306e\u5e74\u9f62\u306f30\u6b73\u3067\u3059\n<\/code><\/pre>\n<h3>\u8f9e\u66f8\u3092\u4f7f\u3063\u305f\u5024\u306e\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">person = {\"name\": \"\u6b21\u90ce\", \"age\": 28}\nmessage = \"{name}\u3055\u3093\u306f{age}\u6b73\u3067\u3059\".format(**person)\nprint(message)  # \u6b21\u90ce\u3055\u3093\u306f28\u6b73\u3067\u3059\n<\/code><\/pre>\n<h3>\u30ea\u30b9\u30c8\u3084\u30bf\u30d7\u30eb\u306e\u8981\u7d20\u30a2\u30af\u30bb\u30b9<\/h3>\n<pre><code class=\"language-python\">data = [\"Python\", 3.9]\nmessage = \"{0[0]}\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f{0[1]}\u3067\u3059\".format(data)\nprint(message)  # Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f3.9\u3067\u3059\n<\/code><\/pre>\n<h2>\u6570\u5024\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h2>\n<h3>\u5c0f\u6570\u70b9\u306e\u6841\u6570\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">pi = 3.14159\nformatted = \"\u5186\u5468\u7387\u306f{:.2f}\u3067\u3059\".format(pi)\nprint(formatted)  # \u5186\u5468\u7387\u306f3.14\u3067\u3059\n<\/code><\/pre>\n<h3>\u6574\u6570\u306e\u6841\u6570\u6307\u5b9a\uff080\u57cb\u3081\uff09<\/h3>\n<pre><code class=\"language-python\">number = 42\nformatted = \"\u756a\u53f7: {:04d}\".format(number)\nprint(formatted)  # \u756a\u53f7: 0042\n<\/code><\/pre>\n<h3>\u4e09\u6841\u533a\u5207\u308a<\/h3>\n<pre><code class=\"language-python\">amount = 1234567\nformatted = \"\u91d1\u984d: {:,}\u5186\".format(amount)\nprint(formatted)  # \u91d1\u984d: 1,234,567\u5186\n<\/code><\/pre>\n<h3>\u30d1\u30fc\u30bb\u30f3\u30c8\u8868\u793a<\/h3>\n<pre><code class=\"language-python\">ratio = 0.8567\nformatted = \"\u6210\u529f\u7387: {:.1%}\".format(ratio)\nprint(formatted)  # \u6210\u529f\u7387: 85.7%\n<\/code><\/pre>\n<h2>\u6587\u5b57\u5217\u306e\u914d\u7f6e\u3068\u30d1\u30c7\u30a3\u30f3\u30b0<\/h2>\n<h3>\u5de6\u5bc4\u305b\u30fb\u53f3\u5bc4\u305b\u30fb\u4e2d\u592e\u5bc4\u305b<\/h3>\n<pre><code class=\"language-python\">text = \"Python\"\nprint(\"'{:&lt;10}'\".format(text))  # 'Python    '\uff08\u5de6\u5bc4\u305b\uff09\nprint(\"'{:&gt;10}'\".format(text))  # '    Python'\uff08\u53f3\u5bc4\u305b\uff09\nprint(\"'{:^10}'\".format(text))  # '  Python  '\uff08\u4e2d\u592e\u5bc4\u305b\uff09\n<\/code><\/pre>\n<h3>\u57cb\u3081\u6587\u5b57\u306e\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">text = \"Python\"\nprint(\"'{:*&lt;10}'\".format(text))  # 'Python****'\nprint(\"'{:=^10}'\".format(text))  # '==Python=='\n<\/code><\/pre>\n<h3>\u6570\u5024\u306e\u7b26\u53f7\u8868\u793a<\/h3>\n<pre><code class=\"language-python\">positive = 42\nnegative = -42\nprint(\"{:+d}\".format(positive))  # +42\nprint(\"{:+d}\".format(negative))  # -42\nprint(\"{: d}\".format(positive))  # ' 42'\uff08\u6b63\u6570\u306e\u5834\u5408\u306f\u7a7a\u767d\uff09\n<\/code><\/pre>\n<h2>\u9032\u6570\u5909\u63db<\/h2>\n<h3>2\u9032\u6570\u30fb8\u9032\u6570\u30fb16\u9032\u6570<\/h3>\n<pre><code class=\"language-python\">number = 255\nprint(\"2\u9032\u6570: {:b}\".format(number))   # 2\u9032\u6570: 11111111\nprint(\"8\u9032\u6570: {:o}\".format(number))   # 8\u9032\u6570: 377\nprint(\"16\u9032\u6570: {:x}\".format(number))  # 16\u9032\u6570: ff\nprint(\"16\u9032\u6570: {:X}\".format(number))  # 16\u9032\u6570: FF\n<\/code><\/pre>\n<h3>\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u4ed8\u304d\u8868\u793a<\/h3>\n<pre><code class=\"language-python\">number = 255\nprint(\"2\u9032\u6570: {:#b}\".format(number))   # 2\u9032\u6570: 0b11111111\nprint(\"8\u9032\u6570: {:#o}\".format(number))   # 8\u9032\u6570: 0o377\nprint(\"16\u9032\u6570: {:#x}\".format(number))  # 16\u9032\u6570: 0xff\n<\/code><\/pre>\n<h2>\u65e5\u4ed8\u3068\u6642\u523b\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h2>\n<h3>datetime \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h3>\n<pre><code class=\"language-python\">from datetime import datetime\nnow = datetime.now()\nformatted = \"{:%Y\u5e74%m\u6708%d\u65e5 %H:%M:%S}\".format(now)\nprint(formatted)  # 2025\u5e7407\u670829\u65e5 14:30:45\n<\/code><\/pre>\n<h3>\u66dc\u65e5\u306e\u8868\u793a<\/h3>\n<pre><code class=\"language-python\">from datetime import datetime\nnow = datetime.now()\nformatted = \"{:%Y-%m-%d (%a)}\".format(now)\nprint(formatted)  # 2025-07-29 (Tue)\n<\/code><\/pre>\n<h2>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5c5e\u6027\u30a2\u30af\u30bb\u30b9<\/h2>\n<h3>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5c5e\u6027\u3092\u76f4\u63a5\u53c2\u7167<\/h3>\n<pre><code class=\"language-python\">class Person:\n    def __init__(self, name, age):\n        self.name = name\n        self.age = age\n\nperson = Person(\"\u7530\u4e2d\", 35)\nmessage = \"{.name}\u3055\u3093\u306f{.age}\u6b73\u3067\u3059\".format(person, person)\nprint(message)  # \u7530\u4e2d\u3055\u3093\u306f35\u6b73\u3067\u3059\n<\/code><\/pre>\n<h3>\u3088\u308a\u7c21\u6f54\u306a\u66f8\u304d\u65b9<\/h3>\n<pre><code class=\"language-python\">class Person:\n    def __init__(self, name, age):\n        self.name = name\n        self.age = age\n\nperson = Person(\"\u4f50\u85e4\", 40)\nmessage = \"{0.name}\u3055\u3093\u306f{0.age}\u6b73\u3067\u3059\".format(person)\nprint(message)  # \u4f50\u85e4\u3055\u3093\u306f40\u6b73\u3067\u3059\n<\/code><\/pre>\n<h2>\u9ad8\u5ea6\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u6307\u5b9a<\/h2>\n<h3>\u52d5\u7684\u306a\u5e45\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">width = 10\ntext = \"Python\"\nformatted = \"{:{width}}\".format(text, width=width)\nprint(f\"'{formatted}'\")  # '    Python'\n<\/code><\/pre>\n<h3>\u52d5\u7684\u306a\u7cbe\u5ea6\u6307\u5b9a<\/h3>\n<pre><code class=\"language-python\">precision = 3\npi = 3.14159\nformatted = \"{:.{prec}f}\".format(pi, prec=precision)\nprint(formatted)  # 3.142\n<\/code><\/pre>\n<h3>\u8907\u5408\u7684\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h3>\n<pre><code class=\"language-python\">name = \"Python\"\nversion = 3.9\nusage = 0.789\nresult = \"{0:&lt;10} | v{1:.1f} | {2:&gt;6.1%}\".format(name, version, usage)\nprint(result)  # Python     | v3.9 |  78.9%\n<\/code><\/pre>\n<h2>\u5b9f\u8df5\u7684\u306a\u4f7f\u7528\u4f8b<\/h2>\n<h3>1. \u30c6\u30fc\u30d6\u30eb\u5f62\u5f0f\u306e\u51fa\u529b<\/h3>\n<pre><code class=\"language-python\">data = [(\"Python\", 3.9, 85.2), (\"Java\", 17.0, 92.1), (\"JavaScript\", 2021, 78.9)]\nprint(\"{:&lt;12} | {:&gt;8} | {:&gt;6}\".format(\"\u8a00\u8a9e\", \"\u30d0\u30fc\u30b8\u30e7\u30f3\", \"\u4eba\u6c17\u5ea6\"))\nprint(\"-\" * 30)\nfor lang, ver, pop in data:\n    print(\"{:&lt;12} | {:&gt;8} | {:&gt;5.1f}%\".format(lang, ver, pop))\n<\/code><\/pre>\n<h3>2. \u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u751f\u6210<\/h3>\n<pre><code class=\"language-python\">from datetime import datetime\nlevel = \"ERROR\"\nmessage = \"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u5931\u6557\"\ntimestamp = datetime.now()\nlog = \"[{:%Y-%m-%d %H:%M:%S}] {:&lt;5}: {}\".format(timestamp, level, message)\nprint(log)  # [2025-07-29 14:30:45] ERROR: \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u5931\u6557\n<\/code><\/pre>\n<h3>3. \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u751f\u6210<\/h3>\n<pre><code class=\"language-python\">config = {\n    \"host\": \"localhost\",\n    \"port\": 8080,\n    \"debug\": True,\n    \"timeout\": 30.5\n}\ntemplate = \"\"\"\n\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a:\n  \u30db\u30b9\u30c8: {host}\n  \u30dd\u30fc\u30c8: {port:d}\n  \u30c7\u30d0\u30c3\u30b0: {debug}\n  \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8: {timeout:.1f}\u79d2\n\"\"\".strip()\nresult = template.format(**config)\nprint(result)\n<\/code><\/pre>\n<h3>4. \u91d1\u878d\u30c7\u30fc\u30bf\u306e\u8868\u793a<\/h3>\n<pre><code class=\"language-python\">stocks = [(\"AAPL\", 150.25, 2.5), (\"GOOGL\", 2800.75, -1.2), (\"MSFT\", 300.50, 0.8)]\nprint(\"{:&lt;6} | {:&gt;8} | {:&gt;7}\".format(\"\u9298\u67c4\", \"\u4fa1\u683c\", \"\u5909\u52d5\u7387\"))\nprint(\"-\" * 25)\nfor symbol, price, change in stocks:\n    print(\"{:&lt;6} | {:&gt;8.2f} | {:&gt;+6.1f}%\".format(symbol, price, change))\n<\/code><\/pre>\n<h2>format()\u3068f-string\uff08f\u6587\u5b57\u5217\uff09\u306e\u6bd4\u8f03<\/h2>\n<h3>format()\u30e1\u30bd\u30c3\u30c9<\/h3>\n<pre><code class=\"language-python\">name = \"Python\"\nversion = 3.9\nmessage = \"{}\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f{}\u3067\u3059\".format(name, version)\nprint(message)  # Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f3.9\u3067\u3059\n<\/code><\/pre>\n<h3>f-string\uff08\u63a8\u5968\uff09<\/h3>\n<pre><code class=\"language-python\">name = \"Python\"\nversion = 3.9\nmessage = f\"{name}\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f{version}\u3067\u3059\"\nprint(message)  # Python\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f3.9\u3067\u3059\n<\/code><\/pre>\n<h3>\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u306e\u6bd4\u8f03<\/h3>\n<pre><code class=\"language-python\"># format()\npi = 3.14159\nresult1 = \"\u5186\u5468\u7387: {:.3f}\".format(pi)\n\n# f-string\nresult2 = f\"\u5186\u5468\u7387: {pi:.3f}\"\nprint(result1, result2)  # \u4e21\u65b9\u3068\u3082: \u5186\u5468\u7387: 3.142\n<\/code><\/pre>\n<h2>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/h2>\n<h3>\u4e00\u822c\u7684\u306a\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5<\/h3>\n<pre><code class=\"language-python\"># KeyError: \u5b58\u5728\u3057\u306a\u3044\u30ad\u30fc\u3092\u6307\u5b9a\ntry:\n    result = \"{name}\u3055\u3093\".format(age=25)\nexcept KeyError as e:\n    print(f\"\u30ad\u30fc\u30a8\u30e9\u30fc: {e}\")\n    result = \"{age}\u6b73\u306e\u65b9\".format(age=25)\n<\/code><\/pre>\n<h3>IndexError: \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7bc4\u56f2\u5916<\/h3>\n<pre><code class=\"language-python\">try:\n    result = \"{0}\u3068{1}\u3068{2}\".format(\"A\", \"B\")  # {2}\u304c\u5b58\u5728\u3057\u306a\u3044\nexcept IndexError as e:\n    print(f\"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30a8\u30e9\u30fc: {e}\")\n    result = \"{0}\u3068{1}\".format(\"A\", \"B\")\n<\/code><\/pre>\n<h3>\u5b89\u5168\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u95a2\u6570<\/h3>\n<pre><code class=\"language-python\">def safe_format(template, *args, **kwargs):\n    \"\"\"\u5b89\u5168\u306a\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\"\"\"\n    try:\n        return template.format(*args, **kwargs)\n    except (KeyError, IndexError, ValueError) as e:\n        return f\"\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30a8\u30e9\u30fc: {e}\"\n\nresult = safe_format(\"{name}\u3055\u3093\u306f{age}\u6b73\", name=\"\u7530\u4e2d\")\nprint(result)  # \u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30a8\u30e9\u30fc: 'age'\n<\/code><\/pre>\n<h2>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u8003\u616e<\/h2>\n<h3>\u5927\u91cf\u30c7\u30fc\u30bf\u3067\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h3>\n<pre><code class=\"language-python\">import time\n\n# format()\u30e1\u30bd\u30c3\u30c9\nstart = time.time()\nresults1 = [\"{}: {}\".format(i, i**2) for i in range(10000)]\ntime1 = time.time() - start\n\n# f-string\uff08\u3088\u308a\u9ad8\u901f\uff09\nstart = time.time()\nresults2 = [f\"{i}: {i**2}\" for i in range(10000)]\ntime2 = time.time() - start\n\nprint(f\"format(): {time1:.4f}\u79d2\")\nprint(f\"f-string: {time2:.4f}\u79d2\")\n<\/code><\/pre>\n<h3>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u518d\u5229\u7528<\/h3>\n<pre><code class=\"language-python\"># \u52b9\u7387\u7684: \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u518d\u5229\u7528\ntemplate = \"\u540d\u524d: {name}, \u5e74\u9f62: {age}\"\ndata = [{\"name\": \"\u592a\u90ce\", \"age\": 25}, {\"name\": \"\u82b1\u5b50\", \"age\": 30}]\nresults = [template.format(**person) for person in data]\n<\/code><\/pre>\n<h2>\u56fd\u969b\u5316\u5bfe\u5fdc<\/h2>\n<h3>\u30ed\u30b1\u30fc\u30eb\u5bfe\u5fdc\u306e\u6570\u5024\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/h3>\n<pre><code class=\"language-python\">import locale\n\n# \u65e5\u672c\u306e\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\uff08\u74b0\u5883\u4f9d\u5b58\uff09\ntry:\n    locale.setlocale(locale.LC_ALL, 'ja_JP.UTF-8')\n    amount = 1234567.89\n    formatted = locale.format_string(\"%.2f\", amount, grouping=True)\n    print(f\"\u91d1\u984d: {formatted}\")\nexcept locale.Error:\n    print(\"\u30ed\u30b1\u30fc\u30eb\u8a2d\u5b9a\u306b\u5931\u6557\")\n<\/code><\/pre>\n<h3>\u591a\u8a00\u8a9e\u5bfe\u5fdc\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h3>\n<pre><code class=\"language-python\">templates = {\n    \"ja\": \"\u3053\u3093\u306b\u3061\u306f\u3001{name}\u3055\u3093\uff01\",\n    \"en\": \"Hello, {name}!\",\n    \"es\": \"\u00a1Hola, {name}!\"\n}\n\ndef greet(name, lang=\"ja\"):\n    return templates.get(lang, templates[\"en\"]).format(name=name)\n\nprint(greet(\"\u7530\u4e2d\", \"ja\"))  # \u3053\u3093\u306b\u3061\u306f\u3001\u7530\u4e2d\u3055\u3093\uff01\nprint(greet(\"Smith\", \"en\"))  # Hello, Smith!\n<\/code><\/pre>\n<h2>\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n<h3>1. \u8aad\u307f\u3084\u3059\u3055\u3092\u91cd\u8996<\/h3>\n<pre><code class=\"language-python\"># \u826f\u3044\u4f8b: \u540d\u524d\u4ed8\u304d\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\nuser_info = \"\u30e6\u30fc\u30b6\u30fc: {username}, \u30ec\u30d9\u30eb: {level}, \u30b9\u30b3\u30a2: {score:,}\".format(\n    username=\"player1\", level=15, score=98765\n)\n\n# \u907f\u3051\u308b\u3079\u304d\u4f8b: \u4f4d\u7f6e\u6307\u5b9a\u306e\u307f\nuser_info = \"\u30e6\u30fc\u30b6\u30fc: {}, \u30ec\u30d9\u30eb: {}, \u30b9\u30b3\u30a2: {:,}\".format(\"player1\", 15, 98765)\n<\/code><\/pre>\n<h3>2. \u30a8\u30e9\u30fc\u51e6\u7406\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-python\">def format_user_data(template, **data):\n    \"\"\"\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u306e\u5b89\u5168\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\"\"\"\n    required_keys = [\"name\", \"age\"]\n    for key in required_keys:\n        if key not in data:\n            raise ValueError(f\"\u5fc5\u9808\u30ad\u30fc '{key}' \u304c\u4e0d\u8db3\u3057\u3066\u3044\u307e\u3059\")\n    \n    return template.format(**data)\n\ntry:\n    result = format_user_data(\"{name}\u3055\u3093({age}\u6b73)\", name=\"\u7530\u4e2d\", age=25)\n    print(result)\nexcept ValueError as e:\n    print(f\"\u30a8\u30e9\u30fc: {e}\")\n<\/code><\/pre>\n<h3>3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305f\u9078\u629e<\/h3>\n<pre><code class=\"language-python\"># Python 3.6\u4ee5\u964d\u3067\u306ff-string\u3092\u63a8\u5968\nname = \"Python\"\nversion = 3.9\n\n# format()\u3088\u308a\u3082f-string\u306e\u65b9\u304c\u9ad8\u901f\u3067\u8aad\u307f\u3084\u3059\u3044\nmessage = f\"{name} {version}\u306e\u6a5f\u80fd\u306f\u7d20\u6674\u3089\u3057\u3044\uff01\"\n<\/code><\/pre>\n<h2>\u30ec\u30ac\u30b7\u30fc\u30b3\u30fc\u30c9\u3068\u306e\u4e92\u63db\u6027<\/h2>\n<h3>%\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304b\u3089\u306e\u79fb\u884c<\/h3>\n<pre><code class=\"language-python\"># \u53e4\u3044%\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\nold_style = \"Hello, %s! You are %d years old.\" % (\"Alice\", 25)\n\n# format()\u3078\u306e\u79fb\u884c\nnew_style = \"Hello, {}! You are {} years old.\".format(\"Alice\", 25)\n\n# \u3055\u3089\u306b\u73fe\u4ee3\u7684\u306af-string\nmodern_style = f\"Hello, {'Alice'}! You are {25} years old.\"\n<\/code><\/pre>\n<h3>\u6bb5\u968e\u7684\u306a\u79fb\u884c\u65b9\u6cd5<\/h3>\n<pre><code class=\"language-python\">def migrate_format(old_template, *args):\n    \"\"\"\u53e4\u3044%\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092format()\u306b\u5909\u63db\uff08\u7c21\u6613\u7248\uff09\"\"\"\n    # %s\u3092{}\u306b\u7f6e\u63db\uff08\u7c21\u6613\u5b9f\u88c5\uff09\n    new_template = old_template.replace(\"%s\", \"{}\")\n    new_template = new_template.replace(\"%d\", \"{}\")\n    return new_template.format(*args)\n\nresult = migrate_format(\"Name: %s, Age: %d\", \"John\", 30)\nprint(result)  # Name: John, Age: 30\n<\/code><\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p><code>format()<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u3001Python\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u91cd\u8981\u306a\u6a5f\u80fd\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u5024\u306e\u57cb\u3081\u8fbc\u307f\u304b\u3089\u3001\u8907\u96d1\u306a\u6570\u5024\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5c5e\u6027\u30a2\u30af\u30bb\u30b9\u307e\u3067\u3001\u5e45\u5e83\u3044\u7528\u9014\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e3b\u306a\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n<ul>\n<li><strong>\u57fa\u672c\u69cb\u6587<\/strong>: <code>\"\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8{}\".format(\u5024)<\/code><\/li>\n<li><strong>\u67d4\u8edf\u306a\u6307\u5b9a\u65b9\u6cd5<\/strong>: \u4f4d\u7f6e\u6307\u5b9a\u3001\u540d\u524d\u4ed8\u304d\u3001\u8f9e\u66f8\u5c55\u958b<\/li>\n<li><strong>\u8c4a\u5bcc\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong>: \u6570\u5024\u3001\u65e5\u4ed8\u3001\u914d\u7f6e\u3001\u9032\u6570\u5909\u63db<\/li>\n<li><strong>\u5b9f\u8df5\u7684\u6d3b\u7528<\/strong>: \u30ed\u30b0\u3001\u30c6\u30fc\u30d6\u30eb\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3001\u56fd\u969b\u5316\u5bfe\u5fdc<\/li>\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/strong>: Python 3.6\u4ee5\u964d\u306ff-string\u3092\u63a8\u5968<\/li>\n<li><strong>\u30a8\u30e9\u30fc\u51e6\u7406<\/strong>: KeyError\u3001IndexError\u306e\u9069\u5207\u306a\u51e6\u7406<\/li>\n<\/ul>\n<p>\u73fe\u5728\u3067\u306ff-string\u304c\u3088\u308a\u63a8\u5968\u3055\u308c\u307e\u3059\u304c\u3001<code>format()<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u3084\u7279\u5b9a\u306e\u7528\u9014\u306b\u304a\u3044\u3066\u4f9d\u7136\u3068\u3057\u3066\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u3066\u3044\u307e\u3059\u3002\u4e21\u65b9\u306e\u7279\u5fb4\u3092\u7406\u89e3\u3057\u3066\u3001\u9069\u5207\u306a\u5834\u9762\u3067\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<h3>\u53c2\u8003\u30ea\u30f3\u30af<\/h3>\n<ul>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/string.html#format-specification-mini-language\">Python\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 &#8211; \u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<\/a><\/li>\n<li><a href=\"https:\/\/www.python.org\/dev\/peps\/pep-3101\/\">PEP 3101 &#8211; Advanced String Formatting<\/a><\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/reference\/lexical_analysis.html#f-strings\">Python\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 &#8211; f-string<\/a><\/li>\n<\/ul>\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=\"zZKdarmOgI\"><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=7RQSWnMBco#?secret=zZKdarmOgI\" data-secret=\"zZKdarmOgI\" 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=\"uG2I4NtVt1\"><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=uuad2UaMCh#?secret=uG2I4NtVt1\" data-secret=\"uG2I4NtVt1\" 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=\"kUi9Duki7G\"><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=atkMjuc0EV#?secret=kUi9Duki7G\" data-secret=\"kUi9Duki7G\" 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=\"NFERaWugFq\"><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=Jsuk3OhPwX#?secret=NFERaWugFq\" data-secret=\"NFERaWugFq\" 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=\"Df2VfUz6F5\"><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=bNYRKNR5oe#?secret=Df2VfUz6F5\" data-secret=\"Df2VfUz6F5\" 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=\"wDniux2OkJ\"><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=xiKXyxS7X8#?secret=wDniux2OkJ\" data-secret=\"wDniux2OkJ\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 Python\u306b\u304a\u3051\u308b\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u3001\u52d5\u7684\u306a\u6587\u5b57\u5217\u751f\u6210\u306b\u304a\u3044\u3066\u6b20\u304b\u305b\u306a\u3044\u6a5f\u80fd\u3067\u3059\u3002format()\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u53e4\u3044%\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u4ee3\u308f\u308b\u67d4\u8edf\u3067\u5f37\u529b\u306a\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u624b\u6cd5\u3068\u3057\u3066\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001 [&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-43001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-column"],"views":57,"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\/43001","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=43001"}],"version-history":[{"count":0,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/posts\/43001\/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=43001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/categories?post=43001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/tags?post=43001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}