{"id":42927,"date":"2025-07-29T08:33:21","date_gmt":"2025-07-28T23:33:21","guid":{"rendered":"https:\/\/techgym.jp\/?p=42927"},"modified":"2025-10-20T00:15:02","modified_gmt":"2025-10-19T15:15:02","slug":"python-while","status":"publish","type":"post","link":"https:\/\/techgym.jp\/column\/python-while\/","title":{"rendered":"\u3010Python\u3011while\u6587\u5b8c\u5168\u30ac\u30a4\u30c92025\u5e74\u7248 &#8211; \u57fa\u790e\u304b\u3089\u96e3\u95a2\u30c6\u30af\u30cb\u30c3\u30af\u307e\u3067"},"content":{"rendered":"\n<p><iframe loading=\"lazy\" width=\"560\" height=\"314\" src=\"\/\/www.youtube.com\/embed\/7iX9nAJE0cE\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n<h2>Python\u306ewhile\u6587\u3068\u306f\uff1f\u57fa\u790e\u77e5\u8b58\u3068\u91cd\u8981\u6027<\/h2>\n<p>while\u6587\u306f\u3001\u6307\u5b9a\u3057\u305f\u6761\u4ef6\u304c\u771f\uff08True\uff09\u3067\u3042\u308b\u9650\u308a\u3001\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308bPython\u306e\u91cd\u8981\u306a\u5236\u5fa1\u69cb\u6587\u3067\u3059\u3002for\u6587\u3068\u4e26\u3093\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u57fa\u672c\u3068\u306a\u308b\u69cb\u6587\u3067\u3001\u6761\u4ef6\u6b21\u7b2c\u3067\u51e6\u7406\u3092\u7d99\u7d9a\u3059\u308b\u305f\u3081\u3001\u52d5\u7684\u306a\u5236\u5fa1\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u57fa\u790e\u7de8\uff1awhile\u6587\u306e\u57fa\u672c\u69cb\u6587\u3068\u4f7f\u3044\u65b9<\/h2>\n<h3>\u57fa\u672c\u7684\u306awhile\u6587\u306e\u69cb\u6587<\/h3>\n<pre><code class=\"language-python\"># \u57fa\u672c\u69cb\u6587\ncount = 0\nwhile count &lt; 5:\n    print(f\"\u30ab\u30a6\u30f3\u30c8: {count}\")\n    count += 1\nprint(\"\u30eb\u30fc\u30d7\u7d42\u4e86\")\n<\/code><\/pre>\n<h3>\u6761\u4ef6\u5f0f\u306e\u66f8\u304d\u65b9<\/h3>\n<pre><code class=\"language-python\"># \u6570\u5024\u6761\u4ef6\nnumber = 10\nwhile number &gt; 0:\n    print(number)\n    number -= 2\n\n# \u6587\u5b57\u5217\u6761\u4ef6\nuser_input = \"\"\nwhile user_input != \"quit\":\n    user_input = input(\"\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\uff08quit\u3067\u7d42\u4e86\uff09: \")\n    print(f\"\u5165\u529b\u5024: {user_input}\")\n<\/code><\/pre>\n<h2>\u4e2d\u7d1a\u7de8\uff1awhile\u6587\u306e\u5b9f\u8df5\u7684\u306a\u6d3b\u7528\u6cd5<\/h2>\n<h3>break\u6587\u3068continue\u6587\u306e\u6d3b\u7528<\/h3>\n<pre><code class=\"language-python\"># break\u6587\u306b\u3088\u308b\u5f37\u5236\u7d42\u4e86\ncount = 0\nwhile True:\n    if count == 3:\n        break\n    print(f\"\u51e6\u7406\u4e2d: {count}\")\n    count += 1\n\n# continue\u6587\u306b\u3088\u308b\u51e6\u7406\u30b9\u30ad\u30c3\u30d7\nnumber = 0\nwhile number &lt; 10:\n    number += 1\n    if number % 2 == 0:\n        continue\n    print(f\"\u5947\u6570: {number}\")\n<\/code><\/pre>\n<h3>else\u53e5\u4ed8\u304dwhile\u6587<\/h3>\n<pre><code class=\"language-python\"># else\u53e5\u306e\u4f7f\u7528\u4f8b\nsearch_list = [1, 3, 5, 7, 9]\ntarget = 4\nindex = 0\n\nwhile index &lt; len(search_list):\n    if search_list[index] == target:\n        print(f\"\u767a\u898b: \u30a4\u30f3\u30c7\u30c3\u30af\u30b9 {index}\")\n        break\n    index += 1\nelse:\n    print(\"\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\")\n<\/code><\/pre>\n<h2>\u4e0a\u7d1a\u7de8\uff1a\u8907\u96d1\u306a\u6761\u4ef6\u3068\u30cd\u30b9\u30c8\u3057\u305fwhile\u6587<\/h2>\n<h3>\u8907\u5408\u6761\u4ef6\u3067\u306ewhile\u6587<\/h3>\n<pre><code class=\"language-python\"># \u8907\u6570\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b\nattempts = 0\nsuccess = False\nmax_attempts = 3\n\nwhile attempts &lt; max_attempts and not success:\n    user_input = input(\"\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b: \")\n    if user_input == \"secret123\":\n        success = True\n        print(\"\u30ed\u30b0\u30a4\u30f3\u6210\u529f\uff01\")\n    else:\n        attempts += 1\n        print(f\"\u5931\u6557\u3002\u6b8b\u308a{max_attempts - attempts}\u56de\")\n\nif not success:\n    print(\"\u30a2\u30ab\u30a6\u30f3\u30c8\u30ed\u30c3\u30af\u3055\u308c\u307e\u3057\u305f\")\n<\/code><\/pre>\n<h3>\u30cd\u30b9\u30c8\u3057\u305fwhile\u6587<\/h3>\n<pre><code class=\"language-python\"># \u4e8c\u91cd\u30eb\u30fc\u30d7\u306e\u4f8b\nouter = 0\nwhile outer &lt; 3:\n    inner = 0\n    while inner &lt; 3:\n        print(f\"\u5916\u5074: {outer}, \u5185\u5074: {inner}\")\n        inner += 1\n    outer += 1\n<\/code><\/pre>\n<h2>\u96e3\u95a2\u7de8\uff1awhile\u6587\u306b\u3088\u308b\u9ad8\u5ea6\u306a\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u5b9f\u88c5<\/h2>\n<h3>\u6570\u5024\u8a08\u7b97\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0<\/h3>\n<pre><code class=\"language-python\"># \u30cb\u30e5\u30fc\u30c8\u30f3\u6cd5\u306b\u3088\u308b\u5e73\u65b9\u6839\u8a08\u7b97\ndef sqrt_newton(number, precision=1e-10):\n    x = number \/ 2  # \u521d\u671f\u5024\n    while True:\n        root = 0.5 * (x + number \/ x)\n        if abs(root - x) &lt; precision:\n            return root\n        x = root\n\nresult = sqrt_newton(25)\nprint(f\"\u221a25 = {result}\")\n<\/code><\/pre>\n<h3>\u30b2\u30fc\u30e0\u7406\u8ad6\u3068\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3<\/h3>\n<pre><code class=\"language-python\">import random\n\n# \u30e2\u30f3\u30c6\u30ab\u30eb\u30ed\u6cd5\u306b\u3088\u308b\u5186\u5468\u7387\u8a08\u7b97\ndef calculate_pi(iterations=100000):\n    inside_circle = 0\n    total_points = 0\n    \n    while total_points &lt; iterations:\n        x = random.uniform(-1, 1)\n        y = random.uniform(-1, 1)\n        \n        if x*x + y*y &lt;= 1:\n            inside_circle += 1\n        total_points += 1\n    \n    return 4 * inside_circle \/ total_points\n\npi_estimate = calculate_pi()\nprint(f\"\u03c0 \u306e\u63a8\u5b9a\u5024: {pi_estimate}\")\n<\/code><\/pre>\n<h3>\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-python\"># while\u6587\u3092\u4f7f\u3063\u305f\u30b9\u30bf\u30c3\u30af\u64cd\u4f5c\nclass Stack:\n    def __init__(self):\n        self.items = []\n    \n    def push(self, item):\n        self.items.append(item)\n    \n    def process_all(self):\n        while self.items:\n            item = self.items.pop()\n            print(f\"\u51e6\u7406\u4e2d: {item}\")\n\nstack = Stack()\nstack.push(\"\u30bf\u30b9\u30af1\")\nstack.push(\"\u30bf\u30b9\u30af2\")\nstack.process_all()\n<\/code><\/pre>\n<h2>\u30a8\u30ad\u30b9\u30d1\u30fc\u30c8\u7de8\uff1awhile\u6587\u306b\u3088\u308b\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/h2>\n<h3>\u72b6\u614b\u6a5f\u68b0\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-python\">class StateMachine:\n    def __init__(self):\n        self.state = \"idle\"\n        self.running = True\n    \n    def run(self):\n        while self.running:\n            if self.state == \"idle\":\n                self.state = self.handle_idle()\n            elif self.state == \"processing\":\n                self.state = self.handle_processing()\n            elif self.state == \"complete\":\n                self.state = self.handle_complete()\n    \n    def handle_idle(self):\n        print(\"\u5f85\u6a5f\u4e2d...\")\n        return \"processing\"\n    \n    def handle_processing(self):\n        print(\"\u51e6\u7406\u4e2d...\")\n        return \"complete\"\n    \n    def handle_complete(self):\n        print(\"\u5b8c\u4e86\")\n        self.running = False\n        return \"idle\"\n\n# \u4f7f\u7528\u4f8b\n# machine = StateMachine()\n# machine.run()\n<\/code><\/pre>\n<h3>\u975e\u540c\u671f\u51e6\u7406\u98a8\u306e\u5b9f\u88c5<\/h3>\n<pre><code class=\"language-python\">import time\n\nclass TaskQueue:\n    def __init__(self):\n        self.tasks = []\n        self.running = False\n    \n    def add_task(self, task):\n        self.tasks.append(task)\n    \n    def start_processing(self):\n        self.running = True\n        while self.running:\n            if self.tasks:\n                task = self.tasks.pop(0)\n                print(f\"\u5b9f\u884c\u4e2d: {task}\")\n                time.sleep(0.1)  # \u51e6\u7406\u6642\u9593\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30c8\n            else:\n                print(\"\u30bf\u30b9\u30af\u5f85\u6a5f\u4e2d...\")\n                time.sleep(0.5)\n    \n    def stop(self):\n        self.running = False\n\nqueue = TaskQueue()\nqueue.add_task(\"\u30c7\u30fc\u30bf\u51e6\u7406\")\nqueue.add_task(\"\u30d5\u30a1\u30a4\u30eb\u4fdd\u5b58\")\n# queue.start_processing()  # \u5b9f\u969b\u306e\u5b9f\u884c\u6642\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\n<\/code><\/pre>\n<h2>while\u6587\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u6280\u8853<\/h2>\n<h3>\u52b9\u7387\u7684\u306a\u6761\u4ef6\u30c1\u30a7\u30c3\u30af<\/h3>\n<pre><code class=\"language-python\"># \u6700\u9069\u5316\u524d\uff1a\u6bce\u56de\u95a2\u6570\u547c\u3073\u51fa\u3057\ndef slow_loop():\n    items = list(range(1000))\n    while len(items) &gt; 0:  # \u6bce\u56delen()\u3092\u8a08\u7b97\n        items.pop()\n\n# \u6700\u9069\u5316\u5f8c\uff1a\u6761\u4ef6\u3092\u4e8b\u524d\u8a08\u7b97\ndef fast_loop():\n    items = list(range(1000))\n    while items:  # Python\u306e\u771f\u507d\u5024\u5224\u5b9a\u3092\u6d3b\u7528\n        items.pop()\n\nfast_loop()\n<\/code><\/pre>\n<h3>\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u6539\u5584<\/h3>\n<pre><code class=\"language-python\"># \u30b8\u30a7\u30cd\u30ec\u30fc\u30bf\u3068while\u6587\u306e\u7d44\u307f\u5408\u308f\u305b\ndef fibonacci_generator(max_value):\n    a, b = 0, 1\n    while a &lt; max_value:\n        yield a\n        a, b = b, a + b\n\n# \u30e1\u30e2\u30ea\u52b9\u7387\u7684\u306a\u51e6\u7406\nfib_gen = fibonacci_generator(100)\nwhile True:\n    try:\n        value = next(fib_gen)\n        print(value)\n    except StopIteration:\n        break\n<\/code><\/pre>\n<h2>while\u6587\u3067\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u7b56<\/h2>\n<h3>\u7121\u9650\u30eb\u30fc\u30d7\u306e\u56de\u907f<\/h3>\n<pre><code class=\"language-python\"># \u5371\u967a\uff1a\u7121\u9650\u30eb\u30fc\u30d7\n# while True:\n#     print(\"\u505c\u6b62\u3057\u307e\u305b\u3093\")\n\n# \u5b89\u5168\uff1a\u30ab\u30a6\u30f3\u30bf\u30fc\u306b\u3088\u308b\u5236\u9650\ndef safe_while_loop():\n    counter = 0\n    max_iterations = 1000\n    \n    while True and counter &lt; max_iterations:\n        # \u4f55\u3089\u304b\u306e\u51e6\u7406\n        counter += 1\n        if some_condition():  # \u7d42\u4e86\u6761\u4ef6\n            break\n    \n    if counter &gt;= max_iterations:\n        print(\"\u6700\u5927\u53cd\u5fa9\u56de\u6570\u306b\u9054\u3057\u307e\u3057\u305f\")\n\ndef some_condition():\n    return True  # \u5b9f\u969b\u306e\u6761\u4ef6\u3092\u3053\u3053\u306b\u8a18\u8ff0\n<\/code><\/pre>\n<h3>\u5883\u754c\u6761\u4ef6\u306e\u51e6\u7406<\/h3>\n<pre><code class=\"language-python\">def safe_input_loop():\n    \"\"\"\u5b89\u5168\u306a\u5165\u529b\u51e6\u7406\u30eb\u30fc\u30d7\"\"\"\n    attempts = 0\n    max_attempts = 3\n    \n    while attempts &lt; max_attempts:\n        try:\n            value = int(input(\"\u6570\u5024\u3092\u5165\u529b: \"))\n            if 1 &lt;= value &lt;= 100:\n                return value\n            else:\n                print(\"1-100\u306e\u7bc4\u56f2\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\")\n        except ValueError:\n            print(\"\u6570\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\")\n        \n        attempts += 1\n    \n    print(\"\u5165\u529b\u8a66\u884c\u56de\u6570\u3092\u8d85\u3048\u307e\u3057\u305f\")\n    return None\n\n# result = safe_input_loop()\n<\/code><\/pre>\n<h2>\u5b9f\u8df5\u7684\u306awhile\u6587\u6d3b\u7528\u4f8b<\/h2>\n<h3>\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u3067\u306e\u6d3b\u7528<\/h3>\n<pre><code class=\"language-python\">def process_large_file(filename):\n    \"\"\"\u5927\u304d\u306a\u30d5\u30a1\u30a4\u30eb\u306e\u884c\u3054\u3068\u51e6\u7406\"\"\"\n    with open(filename, 'r', encoding='utf-8') as file:\n        line_count = 0\n        while True:\n            line = file.readline()\n            if not line:  # \u30d5\u30a1\u30a4\u30eb\u7d42\u7aef\n                break\n            \n            # \u884c\u306e\u51e6\u7406\n            print(f\"\u884c {line_count}: {line.strip()}\")\n            line_count += 1\n    \n    return line_count\n\n# \u4f7f\u7528\u4f8b\uff08\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\uff09\n# count = process_large_file('sample.txt')\n<\/code><\/pre>\n<h3>API\u547c\u3073\u51fa\u3057\u306e\u30ea\u30c8\u30e9\u30a4\u51e6\u7406<\/h3>\n<pre><code class=\"language-python\">import time\nimport random\n\ndef api_call_with_retry():\n    \"\"\"API\u30b3\u30fc\u30eb\u306e\u30ea\u30c8\u30e9\u30a4\u51e6\u7406\"\"\"\n    max_retries = 5\n    retry_count = 0\n    base_delay = 1\n    \n    while retry_count &lt; max_retries:\n        try:\n            # API\u30b3\u30fc\u30eb\u306e\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\n            if random.random() &lt; 0.3:  # 30%\u306e\u78ba\u7387\u3067\u6210\u529f\n                print(\"API\u547c\u3073\u51fa\u3057\u6210\u529f\")\n                return True\n            else:\n                raise Exception(\"API\u547c\u3073\u51fa\u3057\u5931\u6557\")\n                \n        except Exception as e:\n            retry_count += 1\n            if retry_count &gt;= max_retries:\n                print(\"\u6700\u5927\u30ea\u30c8\u30e9\u30a4\u56de\u6570\u306b\u9054\u3057\u307e\u3057\u305f\")\n                return False\n            \n            delay = base_delay * (2 ** retry_count)  # \u6307\u6570\u30d0\u30c3\u30af\u30aa\u30d5\n            print(f\"\u30ea\u30c8\u30e9\u30a4 {retry_count}\/{max_retries} - {delay}\u79d2\u5f8c\u306b\u518d\u8a66\u884c\")\n            time.sleep(delay)\n    \n    return False\n\n# result = api_call_with_retry()\n<\/code><\/pre>\n<h2>while\u6587 vs for\u6587\uff1a\u9069\u5207\u306a\u9078\u629e\u6307\u91dd<\/h2>\n<h3>while\u6587\u304c\u9069\u3057\u3066\u3044\u308b\u5834\u9762<\/h3>\n<pre><code class=\"language-python\"># \u6761\u4ef6\u304c\u52d5\u7684\u306b\u5909\u5316\u3059\u308b\u5834\u5408\ndef dynamic_condition_example():\n    user_points = 0\n    level = 1\n    \n    while user_points &lt; 100 * level:  # \u30ec\u30d9\u30eb\u306b\u5fdc\u3058\u3066\u6761\u4ef6\u304c\u5909\u5316\n        action = input(\"\u30a2\u30af\u30b7\u30e7\u30f3 (work\/study\/quit): \")\n        \n        if action == \"work\":\n            user_points += 10\n        elif action == \"study\":\n            user_points += 15\n            if user_points &gt;= 50 * level:\n                level += 1\n                print(f\"\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7\uff01\u73fe\u5728\u30ec\u30d9\u30eb: {level}\")\n        elif action == \"quit\":\n            break\n    \n    print(f\"\u6700\u7d42\u30b9\u30b3\u30a2: {user_points}, \u30ec\u30d9\u30eb: {level}\")\n\n# dynamic_condition_example()\n<\/code><\/pre>\n<h3>for\u6587\u3068\u306e\u4f7f\u3044\u5206\u3051<\/h3>\n<pre><code class=\"language-python\"># for\u6587\uff1a\u56de\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\nfor i in range(10):\n    print(f\"for\u6587: {i}\")\n\n# while\u6587\uff1a\u6761\u4ef6\u306b\u3088\u3063\u3066\u56de\u6570\u304c\u5909\u308f\u308b\u5834\u5408\ncount = 0\nwhile count &lt; 10:\n    print(f\"while\u6587: {count}\")\n    count += random.randint(1, 3)  # \u4e0d\u898f\u5247\u306a\u5897\u52a0\n<\/code><\/pre>\n<h2>\u307e\u3068\u3081\uff1awhile\u6587\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u305f\u3081\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>Python\u306ewhile\u6587\u306f\u3001\u6761\u4ef6\u306b\u57fa\u3065\u304f\u67d4\u8edf\u306a\u30eb\u30fc\u30d7\u5236\u5fa1\u3092\u53ef\u80fd\u306b\u3059\u308b\u5f37\u529b\u306a\u69cb\u6587\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u9ad8\u5ea6\u306a\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u5b9f\u88c5\u307e\u3067\u3001\u69d8\u3005\u306a\u5834\u9762\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u7fd2\u5f97\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\n<ul>\n<li><strong>\u57fa\u790e\u56fa\u3081<\/strong>: \u57fa\u672c\u69cb\u6587\u3068\u6761\u4ef6\u5f0f\u306e\u7406\u89e3<\/li>\n<li><strong>\u5236\u5fa1\u69cb\u6587<\/strong>: break, continue, else\u306e\u9069\u5207\u306a\u4f7f\u7528<\/li>\n<li><strong>\u30a8\u30e9\u30fc\u5bfe\u7b56<\/strong>: \u7121\u9650\u30eb\u30fc\u30d7\u306e\u56de\u907f\u3068\u5883\u754c\u6761\u4ef6\u306e\u51e6\u7406<\/li>\n<li><strong>\u6700\u9069\u5316<\/strong>: \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30e1\u30e2\u30ea\u52b9\u7387\u306e\u8003\u616e<\/li>\n<\/ul>\n<h3>\u5b9f\u8df5\u3067\u306e\u6ce8\u610f\u70b9<\/h3>\n<ul>\n<li>\u7d42\u4e86\u6761\u4ef6\u3092\u660e\u78ba\u306b\u3059\u308b<\/li>\n<li>\u7121\u9650\u30eb\u30fc\u30d7\u3092\u907f\u3051\u308b\u8a2d\u8a08<\/li>\n<li>\u9069\u5207\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/li>\n<li>for\u6587\u3068\u306e\u4f7f\u3044\u5206\u3051\u3092\u7406\u89e3<\/li>\n<\/ul>\n<p>\u7d99\u7d9a\u7684\u306a\u7df4\u7fd2\u3068\u5b9f\u8df5\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306b\u3088\u308a\u3001while\u6587\u3092\u52b9\u679c\u7684\u306b\u6d3b\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u25a0<a href=\"https:\/\/amzn.to\/3VxGkpx\">\u3089\u304f\u3089\u304fPython\u587e &#8211; \u8aad\u3080\u3060\u3051\u3067\u30de\u30b9\u30bf\u30fc<\/a><\/h2>\n\n\n\n<p><iframe loading=\"lazy\" width=\"560\" height=\"314\" src=\"\/\/www.youtube.com\/embed\/7iX9nAJE0cE\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/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=\"YX6o4fghWa\"><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=TUIWqNaR6n#?secret=YX6o4fghWa\" data-secret=\"YX6o4fghWa\" 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=\"rxdayB37vr\"><a href=\"https:\/\/techgym.jp\/about\/ai-driven-development\/\">AI\u99c6\u52d5\u958b\u767a\/\u751f\u6210AI\u30a8\u30f3\u30b8\u30cb\u30a2\u30b3\u30fc\u30b9\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\u99c6\u52d5\u958b\u767a\/\u751f\u6210AI\u30a8\u30f3\u30b8\u30cb\u30a2\u30b3\u30fc\u30b9\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=cRtl1lIQIS#?secret=rxdayB37vr\" data-secret=\"rxdayB37vr\" 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=\"DSYXqIf5op\"><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=upejHaFrV4#?secret=DSYXqIf5op\" data-secret=\"DSYXqIf5op\" 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=\"Y7zmeVvgCl\"><a href=\"https:\/\/techgym.jp\/event\/nagatacho_camp\/\">\u3010\u6700\u901f\u30fb\u78ba\u5b9f\u3011\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u653b\u7565\u300c\u6c38\u7530\u753aPython\u30df\u30cb\u30ad\u30e3\u30f3\u30d7\u300d\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;\u3010\u6700\u901f\u30fb\u78ba\u5b9f\u3011\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u653b\u7565\u300c\u6c38\u7530\u753aPython\u30df\u30cb\u30ad\u30e3\u30f3\u30d7\u300d\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=vunPTCR5PI#?secret=Y7zmeVvgCl\" data-secret=\"Y7zmeVvgCl\" 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=\"6Qh0VgI8e5\"><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=DAEMlyW7En#?secret=6Qh0VgI8e5\" data-secret=\"6Qh0VgI8e5\" 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=\"b7i9V000Pd\"><a href=\"https:\/\/techgym.jp\/tokyo_python\/\">\u3010\u7121\u6599\u30fb\u30aa\u30f3\u30e9\u30a4\u30f3\u3011\u30bc\u30ed\u304b\u3089\u306f\u3058\u3081\u308bPython\u7206\u901f\u8b1b\u5ea7<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;\u3010\u7121\u6599\u30fb\u30aa\u30f3\u30e9\u30a4\u30f3\u3011\u30bc\u30ed\u304b\u3089\u306f\u3058\u3081\u308bPython\u7206\u901f\u8b1b\u5ea7&#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=tqdmMQdJOP#?secret=b7i9V000Pd\" data-secret=\"b7i9V000Pd\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Python\u306ewhile\u6587\u3068\u306f\uff1f\u57fa\u790e\u77e5\u8b58\u3068\u91cd\u8981\u6027 while\u6587\u306f\u3001\u6307\u5b9a\u3057\u305f\u6761\u4ef6\u304c\u771f\uff08True\uff09\u3067\u3042\u308b\u9650\u308a\u3001\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308bPython\u306e\u91cd\u8981\u306a\u5236\u5fa1\u69cb\u6587\u3067\u3059\u3002for\u6587\u3068\u4e26\u3093\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u57fa\u672c\u3068\u306a\u308b\u69cb\u6587\u3067\u3001\u6761\u4ef6\u6b21\u7b2c\u3067\u51e6 [&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-42927","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-column"],"views":62,"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\/42927","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=42927"}],"version-history":[{"count":0,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/posts\/42927\/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=42927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/categories?post=42927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techgym.jp\/wp-json\/wp\/v2\/tags?post=42927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}