[Tutor] sorting / outputting varibales

ted b phpmoonlighter at yahoo.com
Thu Nov 1 19:39:17 CET 2007


If i input the following in python:
   var1 = 7
   var2 = 9
   var3 = 5
   args = [var1, var2, var3]
   args.sort()

then if if type:

   args

the output is

   [5, 7, 9]

but i want the output to be

   [var3, var1, var2]

is there a function that will output the variable
names in the order they have been sorted instead of
the variable contents themselves?
thanks

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list