Is there other ways to convert a string to int in python2 without int and string.atoi?
Question: Is there other ways to convert a string to int in python2 without int and
string.atoi? Like convert a "2" to 2.


Answer: 
    >>> a="2"
    >>> int(a)
    2
    >>> 
    

I would recommend using try catch,

    
    
    try:
       a = int(a)
    except:
       #do something
    

You can also use `ast` module,

    
    
    >>> import ast
    >>> ast.literal_eval("2")
    2
    >>> 
    

