Code Listings
1.1 Area of a Circle . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1 Mad Lib
®
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 Hypotenuse . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.1 Harmonic Sum . . . . . . . . . . . . . . . . . . . . . . . . . . 19
6.1 Centipede . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8.1 Prime Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 41
8.2 Newton’s Method (Algorithm) . . . . . . . . . . . . . . . . . 47
10.1 Monte Carlo Integration . . . . . . . . . . . . . . . . . . . . . 52
11.1 Pig Latin Translation . . . . . . . . . . . . . . . .

Get A Concise Introduction to Programming in Python 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.