t_11.4up - Whats in your toolbox? Print statement, string...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem Solving with Computing, using the Python Language What’s in your toolbox? Print statement, string literals Basic calculator, integer division Variables Built-in functions Math library functions Straight-line programs Branching programs Python lists For loops Nested for loops Strings While loops Converting between number system using Python Matplotlib Program Design File Processing Graphics Functions Scope of Variables Comments Complex Conditions Testing and Debugging Exception Handling Common Loop Patterns Boolean Operators Unit Testing Classes and Objects Data Collections Searching and Sorting 2 Today’s Topics: 1 Recursion 3 Recall: Functions can call other functions. Let f 1 be the function that maps an integer n to the integer f 1 ( n ) = n 2 Let f 2 be the function that maps an integer n to the integer f 2 ( n ) = n X i =0 f 1 ( i ) = ± f 1 (0) + ··· + f 1 ( n ) if n 0 0 if n < 0 f 1 implementation def fun1 (n ) : return n ** 2 *pyramid of golfballs
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/14/2011.

Page1 / 4

t_11.4up - Whats in your toolbox? Print statement, string...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online