Sort List

Thomas A. Bryan tbryan at python.net
Thu Oct 14 18:11:05 EDT 1999


sorot at my-deja.com wrote:
> 
> I'm the newbie of Python. 

Before posting more questions, you probably want to look at 
http://www.python.org/doc
In particular, read through the tutorial and become familiar with 
the library reference.

See also http://www.python.org/Help.html
That page has pointers to the "tutor" list and to the FAQ.

> I wonder that is there any function for sorting list alphabetically? 

Python 1.5.2 (#1, Apr 18 1999, 16:03:16)  
[GCC pgcc-2.91.60 19981201 (egcs-1.1.1  on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> list = ['apple','orange','banana','kiwi']
>>> list.sort()
>>> list
['apple', 'banana', 'kiwi', 'orange']

> And is there any function to get the date and time of OS?

>>> import time
>>> time.ctime(time.time())
'Thu Oct 14 18:10:36 1999'

---Tom




More information about the Python-list mailing list