You have two places in your code where you have a quote character next to an open parenthesis. You need to put a comma between them as a separate, because if you don't, the parenthesis are treated as the function-call operator and the Python strings are interpreted as if they were functions.
Also, in the future, always include your full traceback verbatim, you'll likely save us a great deal of time helping you. In a case like this, hard-coding input variables so long as the problem is reproducible is always advantageous, since in this case it was reproducible either branch, and the code short and simple enough to understand, that is not always the case.
Join the #python-forum IRC channel on irc.freenode.net!