I am using the online book Dive Into Python.  
I ran the first program given and have run into an error on line 7 at
the colon.  Now I imagine that there is probably a corrections page at
the site, but I am interested in knowing why it won't work as much as
what I need to do to correct it.  Any help would be appreciated.  The
script follows:

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)
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to