This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
cs190c:problemset3_09 [2009/01/31 08:13] seh |
cs190c:problemset3_09 [2009/01/31 08:14] (current) seh |
||
---|---|---|---|
Line 81: | Line 81: | ||
These functions are in file {{cs190c:ps3_09_p2_lib.py|}}. You can use them without making any changes or you can change them. In either case, you need to submit this file - without changing its name - along with file problem2.py. | These functions are in file {{cs190c:ps3_09_p2_lib.py|}}. You can use them without making any changes or you can change them. In either case, you need to submit this file - without changing its name - along with file problem2.py. | ||
+ | |||
Line 142: | Line 143: | ||
| | ||
# Print the distance between two points | # Print the distance between two points | ||
- | print "The distance between A and B is:", distance(pointA, pointB) | + | print "The distance between", pointA, "and", pointB,"is:", distance(pointA, pointB) |
# Find the point in myPoints closest to point B | # Find the point in myPoints closest to point B | ||
closeToB = closest(myPoints, pointB); | closeToB = closest(myPoints, pointB); | ||
- | print "The point closes to B is:", closeToB | + | print "The point closes to", pointB, "is:", closeToB |
# Find the nearest neighbors in myPoints | # Find the nearest neighbors in myPoints |