Maybe a bit more pythonic:
````
factor = int(filter(str.isdigit, operator))
````

Or simply
````
factor = int(operator)
````
and fail on alphanumeric strings?