Don't use Dive into Python Book to learn Python, If you are non-programmer

Don't use Dive into Python Online Book to learn Python, If you were non-programmer.

because, after 2 pages of hello world,

>>> print 'hello world'
hello world

its suddenly goes to following codes, its quite difficult for new programmers.

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)

I believe, iterating dictionary object with this method for new users, just giving headache to them. 
They wont even know what is the dictionary object is.

 ";".join(["%s=%s" % (k, v) for k, v in params.items()]) 


Instead, Read Python's built-in Manual, or Tutorials Part for start learning python.


Read Mark Lutz's Programming Python, 3rd Edition



Unknown said...

Ok Bro, that is good light to me.



ေဘာက္တူး said...

that's right, bro! that 'dive into python' book is suck! it's not easy to learn for beginners.
thanks for your prefer book, bro! :-)

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား