Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

This page removed for FERPA compliance
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Fall 2005 Final Review - Recursion


Any help?

Where do we have exmaples of recursion? The book only shows 1 example. REMOVEDw should we know how to do them all?

wow TA's thanks for the big help....

reversing a string

def flip(word):
if len(word = 1:
return word
else:
return flip(word[1:])+ word[0]

suming numbers

def.sum(list)
if len(list) = 1:
return list[0]
else:
return list[0] + sum(list[1:]

yeah boy howdy

Be careful with your formatting...check your parenthesis, colons and such. There will be points deducted for missing parenthesis. -Student1956




Link to this Page