Fun with Recursion

Lab 9

Until now, the labs have focused on learning the parts and pieces of a programming language—data types, control structures, data structures, and the like. Now we are switching gears to think about different methods of solving problems. Specifically, you’ll be solving iterable problems using recursion instead of loops. When it comes to recursion, there is no substitute for def practice(): return practice().

Goals
  • Learn to identify the recursive component of a problem
  • Learn to determine the base case of a recursive function
  • Practice recursion with strings
  • Visualize recursion with fractals and the picture module
README

Honor Code Reminders:

  • Discussing high-level ideas with other students is encouraged, but only show your actual code to course staff (professors/lab helpers/tutors). The only exception is the warmup, which is to be completed in pairs.
  • Consulting online resources other than assigned reading or documentation provided by the lab instructions is prohibited. Course staff will be happy to answer any questions you have.
  • Use of generative AI for any reason is not allowed. This includes for both writing code and for debugging or reformatting code you wrote.