python If statement Syntax error?
<p>new to python, currently reading <a href="http://www.diveintopython.net/" rel="nofollow">diveintopython</a> and trying to run the following code from the book:</p>

<pre><code>def buildConnectionString(params):
   """Build a connection string from a dictionary of parameters.

      Returns string."""
      return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
if __name__ == "__main__":
      myParams = {"server":"mpilgrim", \
                  "database":"master", \
                  "uid":"sa", \
                  "pwd":"secret" \
                  }
    print buildConnectionString(myParams)
</code></pre>

<p>Now when i hit enter, Python shell says the <code>if</code> statement has a syntax error?? I'm running Python 2.7.</p>
