06.09.2021 Views

How to Think Like a Computer Scientist - Learning with Python, 2008a

How to Think Like a Computer Scientist - Learning with Python, 2008a

How to Think Like a Computer Scientist - Learning with Python, 2008a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

70 Iteration<br />

6.8 More generalization<br />

As another example of generalization, imagine you wanted a program that would<br />

print a multiplication table of any size, not just the six-by-six table. You could<br />

add a parameter <strong>to</strong> printMultTable:<br />

def printMultTable(high):<br />

i = 1<br />

while i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!