Splitting string in python using multiple operations in one line