CS1

Binary and Decimal Conversions

In this lab students work either individually or in pairs to write various functions dealing with binary and ternary numbers. Students must use recursion to convert between binary/ternary/balanced ternary and decimal numbers, as well as to count in binary. This lab reviews binary and ternary numbers and requires students to use recursion. It is particularly useful for students who are new to numbers in different bases and need additional practice with recursion.

Sounds good!

In this lab students work either in pairs or individually to write five functions dealing with list recursion and six functions dealing with sound manipulation. As a warmup, students must perform various operations on lists using list comprehension, such as scaling and replacing certain elements. They then manipulate sound files to play in reverse, at different volume, with static, overlaid with another file, and echoed. This lab requires students to work on list comprehension and file i/o. It is particularly useful for students who are new to Python lists.

The authors of this material were awarded a 2015 NCWIT Engagement Excellence Award for this assignment. Learn more on NCWIT's awards page.

Engagement Excellence

Python Turtles

In this lab students work either individually or in pairs to create three images using turtle graphics. Students must draw a spiral, a recursive tree, and the Koch Snowflake. In addition to reviewing turtle graphics, the lab requires students to create functions that can accept different parameters and to use recursion. The lab is particularly useful for students who are new to graphics and recursion.

Recursion Muscles

In this lab students work in pairs or individually to write seven recursive functions. Without the use of iteration or built-in functions, students must write functions to compute a dot product, return a list of letters in a word, find the index of an element in a sequence, remove elements from a list, filter a list, reverse a list, and find the Scrabble score of a word. This lab requires students to create recursive functions that deal with integers, lists, and strings, as well as to error check. It is particularly useful for students who are new to recursion.

SPAM: SPelling A la Millisoft

In this lab, students create a basic spell checking program. Students must first add memorization to an "edit distance" function and then use the function to return a list of the top ten recommended corrections for a misspelled word. This lab requires students to use recursion and memorization, as well as to time the execution of their code. It is particularly useful for students who need practice using recursion and memorization.

Subscribe to CS1