for index, val in enumerate(args): try: args[index] except IndexError: print "we're empty" else: print "we're empty too"