Encapsulation, inheritance and polymorphism
Lipska the Kat
lipska at lipskathekat.com
Tue Jul 17 08:01:12 EDT 2012
On 17/07/12 09:45, Lipska the Kat wrote:
> Pythoners
>
> Python 2.7.3
> Ubuntu Linux 12.04 LTS
>
> I've been taking a brief look at Python.
>
snip
Well I've set myself a task.
I have a text file containing a list of stock items
each line contains the number in stock followed by a tab followed by the
name of the item. I need to implement something that reads in the text
file and outputs the stock list in ascending or descending order of
quantity.
Please note I am NOT asking for solutions.
In bash this is laughably trivial
sort -nr $1 | head -${2:-10}
Java is easy but long winded and takes a while to set up
C is ... well it's been a while but I'll get there
Python, well that's my current task. It will be interesting to compare
the solutions for speed and ease of development and more importantly
re-usability.
>
> Lipska
>
--
Lipska the Kat: Troll hunter, Sandbox destroyer
and Farscape dreamer of Aeryn Sun.
More information about the Python-list
mailing list