Tutorials, references, and links kan be found at http://www.python.org.
>>> type(2) <type 'int'>If we declare a class C and create an instance c as shown below, type() will give rather general information:
>>> class C: pass >>> c=C() >>> type(C) <type 'classobj'> >>> type(c) <type 'instance'>
>>> isinstance(c, C) TrueThis will evaluate to True if c is an instance of class C or any of C's sub-classes.
In recent versions of Python, it is possible to test for basic types with isinstance as in isinstance(1,int), isinstance(1.2,float) and isinstance([1,2],list).
enscript -Whtml -Epython --color code.py -o code.html
pydoc -w code
The topological sort and strong component algorithms are given here in pseudo-code. More details (on for example algorithm complexity) are found in the literature.
You must work in a team of exactly two people. Previous experience has shown that after the initial transient chaos of finding a partner, this works really well. Try to find a team partner after class. Remember that "pair programming" requires you to actually work together (same place, same time). You may form different teams for different assignments.