Introduction to Python Programming

Introduction to Python Programming#

What is Python?#

Python is a popular programming language [1], especially in the field of data science. Python was named after the “Monty Python’s Flying Circus” BBC show (not after the reptile!)[2]. The Python language has three very desirable features:

  1. Python is an interpreted language; this means that it has an interpreter that runs the code line by line (rather than having to build the whole program before running it as in compiled languages for example).

  2. Python is an Object-Oriented Programming (OOP) language, offering more structure and reusability for larger programs.

  3. Python is a Very High-Level Language (VHLL); allows one to express complex operations in one statement.

Why learn Python?#

There are many good reasons why it is a good idea to choose to learn Python:

  • Easy to learn: Python is one of the easiest programming languages to learn as it is readable as its syntax is very similar to English.

  • Automate tasks: Instead of using a series of clicking and mouse operations, write your code in a file once and then just run it whenever you need it.

  • Promotes reproducibility: Once you have your code you can share it with your colleagues or publish it, so that others will be able to generate the same results as you have. Reproducibility is when others or yourself are able to generate the same results using the same data and analysis.

  • Support: As a widely used programming langauge, Python has a large community. There are lots of resources and help available online.

  • Free: Python is free to use.

  • Open source software

  • Cross-platform: Python runs on different operating systems.
    Hopefully all this has convinced you that Python is a great programming language to learn. Before starting coding in Python, in the next section, we are going to introduce PyCharm, the tool that we will be using throughout the course to code Python in.