cs102 lab1


http://www.maths.nuigalway.ie/~gettrick/teach/cs102/labs/l1.html




Suppose we have a list of integers. These numbers represent the yearly profit (in kilo euro) of n businesses (shops) along the high street in the City centre. Given these numbers, write a PYTHON program to

  1. calculate which business makes the most profit.
  2. calculate which business makes the least profit (i.e. the most loss!).
  3. calculate the average profit of the n businesses.
(In your program, the n numbers should be read in from the user). You must use an iterator for each task - i.e. a loop such as while or for.

© NUI, Galway