Introduction to Python - Python Academy: The Stress Free Way To Learning Python Inside & Out (2014)

Python Academy: The Stress Free Way To Learning Python Inside & Out (2014)

Chapter 1. Introduction to Python

If you are looking for a general purpose, high level programming language with code readability as its main focal point, you should consider Python. It has a syntax that allows you to express concepts using fewer lines of code than other programming languages, such as C, C++, and Java. It supports a wide range of programming paradigms, thereby encompassing imperative, functional and object-oriented programming. Also, it features a comprehensive standard library, a dynamic tape system and an automatic memory management.

There are plenty of interpreters you can use for installation on different operating systems; hence, it is possible for you to execute Python on various systems. You can even make use of third-party applications. If you do not want to install an interpreter, you can package the code into standalone executable programs so that you can effectively distribute Python-based software to different environments.

A Brief History of the Python Programming Language

Python was developed by Guido van Rossum in the late 1980’s. It was initially just a Christmas project. Van Rossum wanted an interpreter for a scripting language that C and UNIX hackers will use. His little project eventually upgraded to Python 2.0, which was released on October 2000. This new version had a complete garbage collector and Unicode support. Python 3.0, also called Python 3000 and py3k, was released in December 2008 and had features that were backported to versions 2.6 and 2.7.

Why should you Use Python?

Programming languages exist for a reason. Python, for instance, was developed to allow programmers to create efficient and productive codes. Its main objective is to help beginners learn a programming language easily and quickly. Due to this less learning time, you can create more useful applications that will be difficult to do with more obscure and complicated programming languages.

With Python, you can also benefit from less development time when coding applications. As mentioned earlier, Python has fewer lines of code than C, C++, and Java. Its codes are actually five to ten times shorter; thus, making it more efficient and less complicated. You get to spend less time in developing applications and more time tweaking and improving them.

When it comes to checking for bugs and errors, it is crucial for the programming language that you use to be easy to read and comprehend. If the programming language is too complicated, you may have a hard time coding and checking your program. With Python, codes are much easier to read and write; hence, you can easily interpret the codes and make the necessary changes.

Furthermore, Python has many other uses. It is ideal for scripting applications that are browser-based, creating great user interfaces and rough application examples, interacting with databases, working with XML and designing mathematic, engineering and scientific applications.

Python vs. C#, Java, and Perl

You may find comparing programming languages with one another to be a subjective task. Usually, their differences are a matter of personal preference. Nonetheless, there are times when such comparisons are backed up by scientific data. Anyway, you have to keep in mind that an all-encompassing programming language does not exist. As a programmer, you just have to find one that works best for your goals or needs.

C#

If you have a background in Java, you may notice that C# and Java are highly similar. Then again, C# still has its own advantages and disadvantages compared to Java. Microsoft claims that their primary objective in developing C# is to produce a better version of C and C++. Compared to C#, however, Python has better scientific and engineering applications and better multiplatform support. It is more extendable when it comes to using C, C++ and Java. It is easier to learn and comprehend, and it allows the use of various computer environments. It also has more concise codes.

Java

Programmers consider Java as a one-stop shop programming language. For many years, they have searched for something that can be run and written anywhere and they found Java, which can perform well in different platforms and computer environments. With this being said, Python is also a one-stop shop programming language. It is very similar to Java, except that it has more concise codes and it is easier to learn and comprehend. It is much faster to develop and it has improved data boxes or variables that can store different data types that are useful when running applications.

PERL

PERL stands for Practical Extraction and Report Language. It is a programming language that is suitable for acquiring and processing data from another database. In comparison, Python is better than PERL because it is easier to read, implement, learn and understand. It has better Java integration and data protection. It also has less platform-specific biases.

Why Python is Ideal for Beginners?

If you have just started programming, you may want to consider Python. It is ideal for beginners because it has a consistent and simple syntax and vast standard library that allows you to do multiple projects. The assignments involved are not limited to the usual four-function calculator and check balancing programs.

As you get used to writing programs in Python, you will realize that it is actually easy to make realistic applications. The interactive interpreter will also allow you to test language features. In Python, you can concentrate on essential programming skills, such as programming decomposition and data type design, and fundamental concepts, including procedures and loops.

Since Python involves the use of multiple libraries and system calls, you can develop applications with interfaces that are easy to program. You can also complete tasks necessary for the application programming interface (API).

Do not worry if you have never used any other programming language before. Even people with no prior programming knowledge or experience can easily grasp the fundamentals of the Python programming language.

As for the installation, Python is easy to install. Most UNIX and Linux distributions actually include it in their package. If you purchase a Windows computer from Hewlett-Packard (HP), you can readily use Python as it comes pre-installed with the system.

To make things easier for you, you should study how to use the text editors as well as the integrated development environments (IDEs). It will also be helpful to read programming books with sample codes and programs.

Regarding copyright, the developers of Python allow programmers to do whatever they want with the source, as long as they do not forget to include the copyrights. The copyright rules are not that strict. You can even sell copies in binary and source form, as well as products involving Python use. However, if you wish to use the logo, see to it that you obtain permission.

Python is highly stable. In fact, it is stable enough for regular use. You can expect a new version within six to eighteen months. The developers issue bug fix releases to ensure that the newer versions are better than the previous ones.

If you want to perform a static analysis or search for bugs, you can use Pylint or PyChecker. The previous is a tool that checks the module to see if it abides by the coding standard as well as allow the customization of plug-ins. The latter is a static analysis tool that finds bugs in the source code.

So now that you have learned about the fundamentals of the programming language, you may still wonder how Python got its name. Was Guido van Rossum fond of pythons? Well, he was actually fond of the television show called Monty Python’s Flying Circus, not the reptile.

During the time of Python’s development, he was reading scripts from the comedy series and thought that‘Python’ will be a suitable name since it was short, unique and has the right amount of mystery. In fact, references to the comedy show are allowed and actually encouraged in documentations.