CME193: IntroductiontoScientificPython Lecture7: Recursion,Exceptionhandling

CME 193: Introduction to Scientific Python Lecture 7: Recursion, Exception handling

Sven Schmit

stanford.edu/~schmit/cme193

7: Recursion, Exception handling

7-1

Contents

Recursion Exception handling Exercises

7: Recursion, Exception handling

7-2

Back to control flow

To execute repetitive code, we have relied on for and while loops. Furthermore, we used if statements to handle conditional statements. These statements are rather straightforward and easy to understand.

7: Recursion, Exception handling

7-3

Recursion

Recursive function solve problems by reducing them to smaller problems of the same form.

This allows recursive functions to call themselves...

New paradigm Powerful tool Divide-and-conquer Beautiful solutions

7: Recursion, Exception handling

7-4

Recursion

Recursive function solve problems by reducing them to smaller problems of the same form.

This allows recursive functions to call themselves...

New paradigm Powerful tool Divide-and-conquer Beautiful solutions

7: Recursion, Exception handling

7-5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download