Difference between revisions of "CSC111 Final Exam 2010"
Line 295: | Line 295: | ||
# will print | # will print | ||
# smallest item = -10 largest item = 20 | # smallest item = -10 largest item = 20 | ||
+ | |||
+ | A = [ 1 ] | ||
+ | low, high = minmax( A ) | ||
+ | print "smallest item =", low, " largest item = ", high | ||
+ | # will print | ||
+ | # smallest item = 1 largest item = 1 | ||
+ | |||
+ | A = [ ] | ||
+ | low, high = minmax( A ) | ||
+ | print "smallest item =", low, " largest item = ", high | ||
+ | # will print | ||
+ | # smallest item = None largest item = None | ||
</source> | </source> |
Revision as of 09:31, 30 April 2010