Welcome to the intermediate Python programming tutorial series. In this series, we're going to be taking the "next steps" after one has become comfortable with the basics of Python, and has been working with it for a bit.
Up to this point, my tutorials have all been done using very basic, rudimentary Python. My definition of basic Python: code that is meant to "just make it run." This is fine for beginners, because there's not much point in overloading with nuances (most people wont retain it, since they don't care, at least I didn't when I was starting out).
I define intermediate Python code as:
In general, code that meets the above standards in Python is done with the Object Oriented Programming (OOP) paradigm. There does exist another paradigm, called Functional Programming (FP), and there are bloody wars fought over which is better. We're going to use OOP. Either one of these is better than outright scripting, which what most beginner programmers are really doing.
To begin this series, I am going to teach a few basic standard library functions and functionalities of Python that will replace otherwise bad habits in programming, before getting into Object Oriented Programming and design.
In this introduction, I will point you towards PEP 8. PEP 8 is a guide for Python styling. Things like white spaces, indentation, naming conventions, and more. PEP 8 is a guide, not a bible.
Finally, as we go through this series, it's a good idea to keep in mind "The Zen of Python" by Tim Peters:
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! >>>
In the next tutorial, we're going to talk about string concatenation and string formatting.