Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage

prime.py: Numerical programming in Python

Tech Computer Center logo

This is a small object illustrating numerical programming in the Python language. Module prime.py defines a class Prime. The purpose of a Prime object is to work with prime numbers---to test numbers for primality, and to find the set of prime factors in a given number.

We could just provide simple functions for primality testing and factoring. However, the process of testing a number for primes involves generating primes. For efficiency's sake, we provide an object that remembers all the primes it has already generated, rather than discarding them.

This object was written and verified using the Cleanroom software development methodology. See the author's Cleanroom page for more information.


Next: Tkinter: GUI programming with Python
See also: Examples of applications written in Python
Previous: A Web access logging report program in Python
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman, john@nmt.edu
Last updated: 2004/03/07 01:42:51 UT
URL: http://www.nmt.edu/tcc/help/lang/python/prime.html
QR two-dimensional bar code