Python is the opposite of working : I am making a super simple program, you can tell what it is by looking at it. The problem is I can't get it to work. Here are my problems:

> python2.7 test.py 1 1234  
> Usage: test.py [option] [number], etc..  

Here it should had print out 134



> 
  
  

> python2.7 test.py 1  

 doesn't do anything... When it should print out the usage.

What's happening? I can't figure out. Here's the code:

    def oddtarray(num):
        tlist = map(int, str(num))
        tnum = [x for x in tlist if (x % 2) != 0]
        return tnum
    def eventarray(num):
        tlist = map(int, str(num))
        tnum = [x for x in tlist if (x % 2) == 0]
        return tnum
    def transform():
        try:
            odd = int(''.join(map(str, eventarray(sys.argv[2]))))
            even = int(''.join(map(str, oddtarray(sys.argv[2]))))
                if len(sys.argv) == 3:
                    if sys.argv[1] == 1:
                        print odd
                    elif sys.argv[1] == 2:
                        print even
                    else:
                        usage()
                else:
                    usage()
                    print ' we are here'
        except IndexError:
            if len(sys.argv) < 2:
                usage()
    def usage():
        print 'Usage: test.py [option] [number]'
        print 'Options: \n[1] - Remove even numbers\n[2] - Remove odd numbers'

    transform()
