I know it's one of those programming languages thought of as an easy thing to learn (or so it seems like it). My problem is not with the difficulty of learning the language, rather the outdated guides and the problems with Python 3.2.
So I looked into a book called Diving into Python. It's free and I thought I would give it a go. It directed me to a website with a download to Python 3.2. I downloaded it and now I'm regretting of trying to learn Python. I don't like to give up easily, but I think this might be the only exception. I have no coding knowledge (well I did learn a bit of C++) so I can't really mess with anything. I'm trying to write this 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)
but I get a syntax error at
buildconnectionstring(myParams)
When I try to run it, it says syntax error occurs at that part.
I'm not sure (since I'm no geek when it comes to Programming), but I'm thinking that maybe because the book I'm using is old, some thing might not be compatible with Python 3.2.
I'm sorry if it seems like I'm an incompetent fool who needs someone to hold his hands, but as dumb as this may sound, programming kinda scares me.
I'm hoping someone nice enough to show a rookie anything can help me out. I'm trying to look for an up-to-date tutorial that wont give me problems in Python 3.2. Or if it's highly unlikely, I would like if someone recommended me an older version of Python and an older tutorial.
I read this topic
http://www.daniweb.com/forums/thread20774.html
But I really don't know which version I should download.
Again I apologize if I did something wrong (probably be too stupid to search even more) but I'm so new to this.
I would like to add that I am a very dedicated learner (as hard as that is to believe), so I will proceed with learning Python even if it takes me 10 years. So please help a new person out.