Book Review: Murach’s Python Programming
Mike Driscoll reviews ''Murach's Python Programming'' and shares his thoughts on the book, including what it does well, its shortfalls, and who could benefit from it.
Join the DZone community and get the full member experience.Join For Free
i review books for the i-programmer website from time to time and they recently gave me a copy of murach’s python programming by michael urban and joel murach. this book is long at almost 600 pages and it’s pretty expensive for the paperback. for those of you with short attention spans, i give you the quick review. for those who would like something a bit more in-depth, you will need to click through to see the rest.
why i picked it up : in this case, because i-programming asked me to.
why i finished it : because this book is well-written and fairly interesting.
i’d give it to : someone who wants to learn python.
you can get a drm ebook from murach itself or just buy the paperback at an online store near you.
this book has 4 sections, 18 chapters and is 576 pages long.
murach isn’t a publisher i was familiar with so i was surprised when i started reading their python programming book and found it to be of such high quality. the book is written by michael urban and joel murach. it is based on python 3 and is an introductory book in nature. the book is split into 4 sections with a total of 18 chapters. let’s spend some time going over the book, chapter-by-chapter.
the first section contains 8 chapters. chapter 1 is a pretty basic introductory chapter and aims to show you the difference between python and other languages. it also goes over how to use idle (python’s included ide) and run a “hello, world” type program. the authors also explain how python “compiles” the source code to byte code before running it. finally, the chapter gives some tips on how to fix syntax and runtime errors.
chapter 2 gives an introduction to coding in python. you will learn about comments, using built-in functions, some of python’s data types, arithmetic expressions, string concatenation and quite a few other topics. there are also two small programs that the authors implement at the end of the chapter using the concepts that you have learned so far.
chapter 3 digs into control statements. in this case, we are talking about python’s if/elif/else statements as well as how relational and logical operators work in python. this chapter also covers python’s looping structures (while and for loops), as well as break and continue statements. i didn’t see any mention of using the “else” statement with your loops, but i’m not sure i’ve ever seen that in a book before. regardless, they update the programs from the previous chapter and demonstrate a couple of new ones using the new concepts in chapter 3.
chapter 4 covers the definition and use of functions and modules. this is a fun littler chapter where you’ll learn about default values, as well as local and global variables. you will also get to create a module, document it, and learn how to import it. they also mention python’s standard library and describe how to import modules from it. finally, we learn how to plan out a program and then code one up.
chapter 5 is where we learn about testing and debugging a program. you will learn about the common python errors and some techniques for testing and debugging your software. as expected, they use idle’s debugger as well as print() statements to help in debugging one’s code. interestingly we don’t learn about exception handling until chapter 8.
chapter 6 is about python’s lists and tuple data types. you will learn the basics of working with lists in this chapter and you will write three more programs throughout the chapter. since tuples are immutable, their coverage is much less, but i think you learn more than enough to use them properly.
chapter 7 is about how to use python’s to work with files. in this chapter, you will learn how to open, create, read and write files. you will also learn about working with binary files and csv files.
chapter 8 is the exception handling chapter. it describes how exceptions work, how to handle single and multiple exceptions, and how to extract information from the exception object. you will also learn about the finally clause and how to raise an exception yourself. this chapter wraps up sections one.
section 2 is described as covering “other concepts and skills” and is only 5 chapters long. i’ll keep this fairly brief:
in chapter 9 , we learn about numbers in general. here are some examples: floating point numbers, formatting numbers, using the locale module, rounding, and the decimal module.
chapter 10 is all about strings. we will learn a bit about unicode, slicing, indexes, splitting, and joining strings. we will also create or enhance 4 programs. the most complex is a hangman game and is well worth reading about as it splits the functionality of the game into multiple modules.
for chapter 11 , the topic is working with dates and times. you will learn the basics of python’s time and datetime modules in this chapter and create a few programs using them too.
in chapter 12 , we finally learn about one of python’s most important data types: the dictionary (or dict). here you will learn how to create a dictionary as well as get, set, add items, and delete items. there is also some information on converting a dict to a list and adding more complex values to your dictionaries. as usual, you will create some simple programs in this chapter.
this section wraps up in chapter 13 where we learn about recursion and algorithms. about half the chapter is devoted to learning about recursion works and how it works in python. the rest covers some common algorithms, such as the factorial, the fibonacci sequence and the towers of hanoi.
section 3 is about object oriented programming (oop) in python. it only has 3 chapters. basically, these 3 chapters cover defining and using your classes, inheritance and the design aspect you need to use when doing object oriented programming. you will create more fun mini-programs in this chapter and learn lots of good information such as how polymorphism works, overriding methods, how to create custom exceptions, etc.
the last two chapters are in section 4.
chapter 17 is an introduction to databases and then dives into using python’s sqlite module, sqlite3. it does not talk about any of the 3rd party modules you can use to connect to enterprise level databases, though. by the end of the chapter, you should know how to create a database as well as use select statements and insert, update and delete statements in sql.
the final chapter is chapter 18 . it is an introduction to creating a gui program using tkinter. the tkinter module has entire books based on it, so don’t expect this chapter to cover all that much. what you will learn is how two write a simple future value calculator application, which is nice. but you won’t learn much more than that.
overall i thought this book was well thought out and executed. the book uses a “paired pages” approach, so it has syntax, guidelines and examples on the right page and extra explanatory information on the left. i’m sure this works well in book form, but in their ebook version, it is a bit awkward. in fact, i really can’t recommend the ebook that you get direct from murach. it uses a drm application called locklizard safeguard that you have to download. you will get a license file that you will need to run before you can open your book, which is in a .pdc format. the application currently only supports windows and mac, so for linux, you are just plain out of luck. the application looks like adobe’s reader application, but it’s extremely limited. you cannot highlight or add comments. i used it in windows and found that if you had the bookmarks pane in focus, then you could only scroll in that. you would need to click back in the book pane to be able to scroll there.
anyway besides the obnoxious ebook client, the book is actually quite good. i feel like it covered the topics well and included some items that you don’t always see in introductory python books, such as the csv, database and gui examples. the rest of the book is pretty standard fair for a beginner’s book, but the text is clear and the examples are interesting. i really like that you get to write mini-programs in almost all of the chapters and that they almost always do something besides just printing out a string. i believe this is a worthy book for someone who wants to learn python, but if you already know python, then this book probably won’t have anything of interest for you.
murach’s python programmingby michael urban and joel murach
Published at DZone with permission of Mike Driscoll, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.