Main.Lab5 History

Hide minor edits - Show changes to markup

February 21, 2013, at 02:21 PM MST by 129.82.44.223 -
Changed lines 3-8 from:

Objectives: practice lists and file traversal

Reading numbers from a file

Write a function that receives a file name as a parameter and reads the numbers in the file and returns them as a list.

to:

Objectives: practice lists

Added lines 8-12:

Checking if a list is sorted

Write a function called is_sorted(list) that receives a list as input and returns True if it's sorted in ascending order, and False otherwise.

February 21, 2010, at 07:30 PM MST by 71.196.160.210 -
Added lines 1-13:

Lab 5

Objectives: practice lists and file traversal

Reading numbers from a file

Write a function that receives a file name as a parameter and reads the numbers in the file and returns them as a list.

Maximum/minimum finding

Write a function that receives as input a list of numbers and returns the maximum and minimum numbers in the list. You can return multiple values by a statement like return x,y. The calling code should be: M,m = min-max(list).