[Tutor] def_a

elis aeris hunter92383 at gmail.com
Mon Mar 24 02:25:00 CET 2008


def_a =[
         ["3.2.2.2.2.2.3.", "0.0.3.2.2.2.2.2.3.0.0.0.", "O"],
         ["8.1.1.4.", "0.0.2.2.2.2.3.1.1.1.0.0.", "h"],
         ["1.2.", "0.1.1.1.0.0.0.0.0.0.0.0.", ","],
         ["2.7.2.", "0.0.3.1.1.1.1.1.3.0.0.0.", "I"],
         ["5.1.1.4.1.1.4.", "0.0.3.3.3.3.5.0.0.0.0.0.", "m"],
         ["3.3.3.3.", "0.0.3.1.4.2.2.0.0.0.0.0.", "e"],
         ["1.3.3.4.", "0.0.3.2.3.1.2.0.0.0.0.0.", "a"],
         ["5.1.1.4.", "0.0.2.2.2.2.3.0.0.0.0.0.", "n"],
         ["2.", "0.0.1.1.0.0.0.0.0.0.0.0.", "."],
         ["7.1.1.1.1.", "0.0.5.1.1.1.1.1.1.0.0.0.", "L"],
         ["1.5.2.2.", "0.0.2.1.1.1.4.1.0.0.0.0.", "t"],
         ["3.", "0.0.0.0.0.0.0.1.1.1.0.0.", "'"],
         ["2.3.3.2.", "0.0.3.1.2.1.3.0.0.0.0.0.", "s"],
         ["3.3.3.6.", "2.1.3.2.2.2.3.0.0.0.0.0.", "g"],
         ["3.2.2.3.", "0.0.2.2.2.2.2.0.0.0.0.0.", "o"],
         ["8.2.2.3.", "0.0.3.2.2.2.3.1.1.1.0.0.", "b"],
         ["4.1.1.5.", "0.0.3.2.2.2.2.0.0.0.0.0.", "u"],
         ["6.", "0.0.1.1.1.1.1.0.1.0.0.0.", "i"],
         ["6.", "0.0.1.0.1.1.1.1.1.0.0.0.", "!"]
,

       ]

def returnzero:
    return def_a[2]





this is a simple version of the function i use, and of course in the real
version [0] and [1] is used as well.

what I am trying to do is to write a generic function like this

def returnzero (def_a):
    return def_a




in other words, a generic function that is able to use any list assigned to
it, so that i don't have to write 8 functions just to use 8 list,because
that would be dumb, right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080323/f6a943c1/attachment.htm 


More information about the Tutor mailing list