Assign part of a string to a variable [Python]
Question: So I have the string:

    
    
    [53,2]
    

And I want to seperate it so that:

    
    
    x = 52
    y = 2
    


Answer: Easy!

    
    
    X, y = [53, 2]
    

Isn't Python fun?

If your object is actually a string and not a list, you can safely convert it
to a list:

    
    
    import ast
    x, y = ast.literal_eval("[53, 2]")
    

