“91974˙CH02˙final” 2012/12/14 13:58 page 45 #1
CHAPTER
2
othon
2.1 Objectives
To understand how computers can help solve real problems
To further explore numeric expressions, variables, and assignment
To understand the accumulator pattern
To utilize the math library
To further explore simple iteration patterns
To understand simple selection statements
To use random numbers to approximate an area
2.2 What Is Pi?
In this chapter we will continue to explore computer science, problem solving, and the
Python programming language by considering one of the most famous numbers of all: the
number pi, often represented by the Greek letter π. Almost ev ...

Get Python Programming in Context, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.