<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>関数 on プログラミング演習B</title><link>https://ksubpb.github.io/2026/tags/%E9%96%A2%E6%95%B0/</link><description>Recent content in 関数 on プログラミング演習B</description><generator>Hugo -- gohugo.io</generator><language>ja</language><copyright>© 2026</copyright><lastBuildDate>Wed, 21 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ksubpb.github.io/2026/tags/%E9%96%A2%E6%95%B0/index.xml" rel="self" type="application/rss+xml"/><item><title>関数(2/2) 高度な引数の扱い</title><link>https://ksubpb.github.io/2026/lesson03/function/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/function/</guid><description>Pythonでは、高度な引数の扱いが可能で、引数の数が一致していなくてもエラーにならないようにできます。</description></item><item><title>再帰呼び出し</title><link>https://ksubpb.github.io/2026/lesson04/recursive/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson04/recursive/</guid><description>&lt;h2 class="relative group"&gt;再帰呼び出し&#10; &lt;div id="再帰呼び出し" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e5%86%8d%e5%b8%b0%e5%91%bc%e3%81%b3%e5%87%ba%e3%81%97" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;再帰呼び出しとは、ある関数が自分自身を呼び出すことを指します。&#10;数学の漸化式をそのままプログラムで表現したものとして捉えることができます。&lt;/p&gt;</description></item><item><title>変数とスコープ</title><link>https://ksubpb.github.io/2026/lesson03/scope/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/scope/</guid><description>プログラム言語で扱う変数には、有効範囲がありスコープと呼ばれます。</description></item><item><title>第02講 基本データ型（2/2; セット、ディクショナリ）、関数（1/2; 関数の基礎）</title><link>https://ksubpb.github.io/2026/lesson02/</link><pubDate>Wed, 07 Oct 2026 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson02/</guid><description>&lt;h2 class="relative group"&gt;概要&#10; &lt;div id="概要" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e6%a6%82%e8%a6%81" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;第02講では、前半で集合を扱うもののうち &lt;strong&gt;セット（set）&lt;/strong&gt; と &lt;strong&gt;ディクショナリ（dictionary）&lt;/strong&gt; について学習します。&#10;セットは順序なしの要素の集まりであり、ディクショナリはキーと値のペアの集まりです。&lt;/p&gt;</description></item><item><title>assert文によるテスト</title><link>https://ksubpb.github.io/2026/lesson03/assert_test/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/assert_test/</guid><description>プログラムが期待通りに動いているかを確認するためには、実行してみて、実行結果が期待通りであるかを確認するテストを実施する必要があります。ここではこのテストの１手法を学びます。</description></item><item><title>関数(1/2) 関数の基礎</title><link>https://ksubpb.github.io/2026/lesson02/function/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson02/function/</guid><description>&lt;h2 class="relative group"&gt;関数とは&#10; &lt;div id="関数とは" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e9%96%a2%e6%95%b0%e3%81%a8%e3%81%af" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;span class="flex" style="cursor: pointer;"&gt;&#10; &lt;span class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"&gt;&#10; 教科書 p.163（Lesson 7）&#10; &lt;/span&gt;&#10;&lt;/span&gt;&#10;&#10;&#10;&lt;p&gt;関数とは、処理の集まりに名前をつけたものです。&#10;何度も行う処理の集まりがあったときに、その処理を関数として定義しておくことで、同じ処理を何度も書く必要がなくなります。&lt;/p&gt;</description></item><item><title>第03講 関数（2/2; 関数の応用）</title><link>https://ksubpb.github.io/2026/lesson03/</link><pubDate>Wed, 14 Oct 2026 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/</guid><description>&lt;h2 class="relative group"&gt;概要&#10; &lt;div id="概要" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e6%a6%82%e8%a6%81" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;第03講では、前回の後半に引き続き関数について学習します。&#10;より高度な関数の使い方で、知っているとプログラムが楽に書けるようになる機能である、&#10;デフォルト引数、可変長引数、キーワード引数を紹介します。&lt;/p&gt;</description></item><item><title>第04講 再帰関数（1/2; 再帰関数の基礎）</title><link>https://ksubpb.github.io/2026/lesson04/</link><pubDate>Wed, 21 Oct 2026 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson04/</guid><description>&lt;h2 class="relative group"&gt;再帰関数&#10; &lt;div id="再帰関数" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e5%86%8d%e5%b8%b0%e9%96%a2%e6%95%b0" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;第04講では、再帰関数（recursive function）について学習します。&#10;再帰関数は、関数の中で自分自身を呼び出すことができる関数です。&lt;/p&gt;</description></item><item><title>デコレータ</title><link>https://ksubpb.github.io/2026/supplemental/advanced/decorator/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/supplemental/advanced/decorator/</guid><description>&lt;h2 class="relative group"&gt;デコレータ&#10; &lt;div id="デコレータ" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e3%83%87%e3%82%b3%e3%83%ac%e3%83%bc%e3%82%bf" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;span class="flex" style="cursor: pointer;"&gt;&#10; &lt;span class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"&gt;&#10; 教科書 p.193（Lesson 7.5）&#10; &lt;/span&gt;&#10;&lt;/span&gt;&#10;&#10;&#10;&lt;p&gt;Python のデコレータとは、関数やメソッドを修飾するための機能です。&#10;デコレータは、関数を受け取り、関数を返すような関数です。&lt;/p&gt;</description></item><item><title>第02講 週次課題</title><link>https://ksubpb.github.io/2026/lesson02/assignments/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson02/assignments/</guid><description>&lt;h2 class="relative group"&gt;課題02-1 単語数の分布&#10; &lt;div id="課題02-1-単語数の分布" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e8%aa%b2%e9%a1%8c02-1-%e5%8d%98%e8%aa%9e%e6%95%b0%e3%81%ae%e5%88%86%e5%b8%83" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="flex mt-2"&gt;&#10; &lt;span&#10; class="rounded-full bg-primary-500 dark:bg-primary-400 text-neutral-50 dark:text-neutral-800 px-1.5 py-[1px] text-xs font-normal"&gt;&#10; &lt;span class="flex flex-row items-center"&gt;&lt;span class="mr-1"&gt;&lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"&gt;&lt;path fill="currentColor" d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"/&gt;&lt;/svg&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;難易度 ⭐⭐&lt;/span&gt;&#10; &lt;/span&gt;&#10; &lt;/span&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;&lt;a href="../assets/alice_chapter01.txt" &gt;&lt;code&gt;alice_chapter01.txt&lt;/code&gt;&lt;/a&gt; は、ルイス・キャロルの「&lt;a href="https://www.gutenberg.org/files/11/11-h/11-h.htm" target="_blank" rel="noreferrer"&gt;不思議の国のアリス&lt;/a&gt;」の第01章のテキストファイルです。&#10;このファイルの単語の頻度を求めてください。&lt;/p&gt;</description></item><item><title>第03講 週次課題</title><link>https://ksubpb.github.io/2026/lesson03/assignments/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/assignments/</guid><description>&lt;h2 class="relative group"&gt;課題03-1 デフォルト引数を持つ Hello World&#10; &lt;div id="課題03-1-デフォルト引数を持つ-hello-world" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e8%aa%b2%e9%a1%8c03-1-%e3%83%87%e3%83%95%e3%82%a9%e3%83%ab%e3%83%88%e5%bc%95%e6%95%b0%e3%82%92%e6%8c%81%e3%81%a4-hello-world" aria-label="アンカー"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="flex mt-2"&gt;&#10; &lt;span&#10; class="rounded-full bg-primary-500 dark:bg-primary-400 text-neutral-50 dark:text-neutral-800 px-1.5 py-[1px] text-xs font-normal"&gt;&#10; &lt;span class="flex flex-row items-center"&gt;&lt;span class="mr-1"&gt;&lt;span class="relative block icon"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"&gt;&lt;path fill="currentColor" d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z"/&gt;&lt;/svg&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;難易度 ⭐&lt;/span&gt;&#10; &lt;/span&gt;&#10; &lt;/span&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;以下の条件を満たす関数 &lt;code&gt;hello&lt;/code&gt; を作成してください。&lt;/p&gt;</description></item><item><title>まとめ</title><link>https://ksubpb.github.io/2026/lesson02/summary/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson02/summary/</guid><description>まとめ（データ構造　セット、ディクショナリ、関数の基礎）</description></item><item><title>まとめ</title><link>https://ksubpb.github.io/2026/lesson03/summary/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson03/summary/</guid><description>まとめ（高度な引数の扱い、変数のスコープ、assert文によるテスト）</description></item><item><title>まとめ</title><link>https://ksubpb.github.io/2026/lesson04/summary/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ksubpb.github.io/2026/lesson04/summary/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="../recursive/#%E5%86%8D%E5%B8%B0%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97" &gt;再帰呼び出し&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="../recursive/#%E5%86%8D%E5%B8%B0%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E3%81%AE%E4%BE%8B-1-%E9%9A%8E%E4%B9%97" &gt;再帰呼び出しの例 1: 階乗&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../recursive/#%E5%9F%BA%E5%BA%95%E6%9D%A1%E4%BB%B6%E3%81%A8%E5%86%8D%E5%B8%B0%E6%9D%A1%E4%BB%B6" &gt;基底条件と再帰条件&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../recursive/#%E5%86%8D%E5%B8%B0%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E3%81%AE%E3%82%B7%E3%83%9F%E3%83%A5%E3%83%AC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3" &gt;再帰呼び出しのシミュレーション&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../recursive/#%E5%86%8D%E5%B8%B0%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E3%81%AE%E4%BE%8B-2-%E3%83%AA%E3%82%B9%E3%83%88%E3%81%AE%E5%90%88%E8%A8%88" &gt;再帰呼び出しの例 2: リストの合計&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../practice" &gt;再帰の練習&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="../practice/#%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E3%81%AE%E6%A7%98%E5%AD%90%E3%82%92%E8%A1%A8%E7%A4%BA%E3%81%99%E3%82%8B" &gt;呼び出しの様子を表示する&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../practice/#%E5%A3%8A%E3%82%8C%E3%81%9F%E5%86%8D%E5%B8%B0%E3%82%92%E7%9B%B4%E3%81%99" &gt;壊れた再帰を直す&lt;/a&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="../practice/#%E5%86%8D%E5%B8%B0%E3%81%8C%E6%AD%A2%E3%81%BE%E3%82%89%E3%81%AA%E3%81%84%E3%81%A8%E3%81%8D%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%83%AA%E3%82%B9%E3%83%88" &gt;再帰が止まらないときのチェックリスト&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="../practice/#%E3%82%84%E3%81%A3%E3%81%A6%E3%81%BF%E3%82%88%E3%81%86-%E3%83%AA%E3%82%B9%E3%83%88%E3%81%AE%E6%9C%80%E5%A4%A7%E5%80%A4" &gt;やってみよう: リストの最大値&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item></channel></rss>