Python string calculator practice