Ran Libeskind-Hadas https://www.csteachingtips.org/ en Ask students “What is the simplest input to this problem?” when teaching recursion to help students learn to identify appropriate base cases for each argument of their function. https://www.csteachingtips.org/tip/ask-students-what-simplest-input-problem-when-teaching-recursion-help-students-learn-identify <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Ask students “What is the simplest input to this problem?” when teaching recursion to help students learn to identify appropriate base cases for each argument of their function.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-06-29T14:26:25-07:00" title="Monday, June 29, 2015 - 14:26" class="datetime">Mon, 06/29/2015 - 14:26</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/ask-students-what-simplest-input-problem-when-teaching-recursion-help-students-learn-identify" data-a2a-title="Ask students “What is the simplest input to this problem?” when teaching recursion to help students learn to identify appropriate base cases for each argument of their function."><a class="a2a_button_facebook"><span class="a2a_label">Share Ask students “What is the simplest input to this problem?” when teaching recursion to help students learn to identify appropriate base cases for each argument of their function. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Ask students “What is the simplest input to this problem?” when teaching recursion to help students learn to identify appropriate base cases for each argument of their function. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>For instance, factorial functions have one input, so they should expect one base case whereas recursive functions with two inputs will generally have two base cases, one for each of the extreme values. </li> </ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Mon, 29 Jun 2015 21:26:25 +0000 cstt 887 at https://www.csteachingtips.org Use Python’s map function to introduce students to loops early on, because the map function is an provides an easy transition to loops. https://www.csteachingtips.org/tip/use-pythons-map-function-introduce-students-loops-early-because-map-function-provides-easy <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Use Python’s map function to introduce students to loops early on, because the map function is an provides an easy transition to loops.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-06-29T14:14:25-07:00" title="Monday, June 29, 2015 - 14:14" class="datetime">Mon, 06/29/2015 - 14:14</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/use-pythons-map-function-introduce-students-loops-early-because-map-function-provides-easy" data-a2a-title="Use Python’s map function to introduce students to loops early on, because the map function is an provides an easy transition to loops."><a class="a2a_button_facebook"><span class="a2a_label">Share Use Python’s map function to introduce students to loops early on, because the map function is an provides an easy transition to loops. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Use Python’s map function to introduce students to loops early on, because the map function is an provides an easy transition to loops. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>Introducing students to loops early is a good way to keep programs they create interesting.</li> <li>Loops help create an interesting and complicated problems.</li> <ul><li>For example, tell the story of when Carl Friedrich Gauss was in first grade, he and his classmates were told (as a form of punishment) to add up the numbers from 1 to 100. What is that sum? We can write a simple function using map to compute it.</li> </ul></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Mon, 29 Jun 2015 21:14:25 +0000 cstt 883 at https://www.csteachingtips.org Ask students "do you know in advance how many times you'll need to go through the loop?" when deciding between using a for or a while loop, because this is a good rule of thumb for them to use. https://www.csteachingtips.org/tip/ask-students-do-you-know-advance-how-many-times-youll-need-go-through-loop-when-deciding <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Ask students &quot;do you know in advance how many times you&#039;ll need to go through the loop?&quot; when deciding between using a for or a while loop, because this is a good rule of thumb for them to use.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-06-29T13:36:04-07:00" title="Monday, June 29, 2015 - 13:36" class="datetime">Mon, 06/29/2015 - 13:36</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/ask-students-do-you-know-advance-how-many-times-youll-need-go-through-loop-when-deciding" data-a2a-title="Ask students &quot;do you know in advance how many times you&#039;ll need to go through the loop?&quot; when deciding between using a for or a while loop, because this is a good rule of thumb for them to use."><a class="a2a_button_facebook"><span class="a2a_label">Share Ask students &quot;do you know in advance how many times you&#039;ll need to go through the loop?&quot; when deciding between using a for or a while loop, because this is a good rule of thumb for them to use. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Ask students &quot;do you know in advance how many times you&#039;ll need to go through the loop?&quot; when deciding between using a for or a while loop, because this is a good rule of thumb for them to use. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>This question is a good is a great tool for choosing between for and while loops.</li> <li>Give several small examples of looping problems, and ask the class which loop structure is appropriate, without writing any code. Once you reach a consensus, go back and explicitly write the code in the language you are using.</li> </ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Mon, 29 Jun 2015 20:36:04 +0000 cstt 874 at https://www.csteachingtips.org Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes. https://www.csteachingtips.org/tip/help-students-build-intuition-about-recursion-python-comparing-each-recursive-call-function <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--title--tip.html.twig x field--node--title.html.twig * field--node--tip.html.twig * field--title.html.twig * field--string.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <span class="field field--name-title field--type-string field--label-hidden">Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes.</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--title.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--uid--tip.html.twig x field--node--uid.html.twig * field--node--tip.html.twig * field--uid.html.twig * field--entity-reference.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <span class="field field--name-uid field--type-entity-reference field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'username' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> <span>cstt</span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/user/username.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--uid.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--created--tip.html.twig x field--node--created.html.twig * field--node--tip.html.twig * field--created.html.twig * field--created.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <span class="field field--name-created field--type-created field--label-hidden"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'time' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> <time datetime="2015-06-29T13:30:25-07:00" title="Monday, June 29, 2015 - 13:30" class="datetime">Mon, 06/29/2015 - 13:30</time> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/time.html.twig' --> </span> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--node--created.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'links__node' --> <!-- FILE NAME SUGGESTIONS: * links--node.html.twig x links--inline.html.twig * links--node.html.twig * links.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/navigation/links--inline.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'addtoany_standard' --> <!-- FILE NAME SUGGESTIONS: * addtoany-standard--node--tip.html.twig * addtoany-standard--node.html.twig x addtoany-standard.html.twig --> <!-- BEGIN OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <span class="a2a_kit a2a_kit_size_32 addtoany_list" data-a2a-url="https://www.csteachingtips.org/tip/help-students-build-intuition-about-recursion-python-comparing-each-recursive-call-function" data-a2a-title="Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes."><a class="a2a_button_facebook"><span class="a2a_label">Share Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes. with Facebook</span></a><a class="a2a_button_twitter"><span class="a2a_label">Share Help students build intuition about recursion in Python by comparing each recursive call to a function call, which may be more intuitive for students in introductory classes. with Twitter</span></a></span> <!-- END OUTPUT from 'modules/contrib/addtoany/templates/addtoany-standard.html.twig' --> <!-- THEME DEBUG --> <!-- THEME HOOK: 'field' --> <!-- FILE NAME SUGGESTIONS: * field--node--body--tip.html.twig * field--node--body.html.twig * field--node--tip.html.twig * field--body.html.twig x field--text-with-summary.html.twig * field.html.twig --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><ul><li>When a function calls another function in Python, the first function pauses and then waits for the next functions output.</li> <ul><li>Similarly, a recursive call is simply calling itself over and over again.</li> </ul><li>Recursion isn’t special; it’s simply the rule for how function calls work. Make this clear to your students by tracing through a simple recursive function (e.g. adding up the numbers from 1 to n).</li> </ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap_barrio/templates/field/field--text-with-summary.html.twig' --> Mon, 29 Jun 2015 20:30:25 +0000 cstt 873 at https://www.csteachingtips.org