Why Python

Python is one of the most popular programming languages. It is expressive, meaning that a lot of work can be done in a few lines of code. Python is versatile. It can be used to create websites, artificial intelligence models, games, and more. Python is one of the top languages used by cybersecurity professionals.

Learning Objectives

You should be able to:

  • Describe the Python design philosophy
  • List some notable Python projects

Python's Evolution

Python first appeared in 1991. It was created by Guido van Rossum who continued to lead the Python project for decades. Some of Python's goals are listed in PEP 20 - The Zen of Python.

  • Beautiful is better than ugly.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Readability counts.
  • There should be one-- and preferably only one --obvious way to do it.

Python is free for anybody to download and use. Many developers build libraries that extend Python's base functionality to add features. Your Python code can leverage these libraries to reduce the amount of code you need to write to solve problems. These libraries are often given away for free. For example, PyTorch is a premier machine-learning library that anybody can use for free.

The Python community encourages sharing code and best practices. There are thousands of resources to help you learn Python.

Notable Python Projects

Many thousands of projects have used Python. Below are just a few that show the breadth of use cases for Python.

  • Python was used to analyze data to produce the first image of a black hole.

Black Hole. Source: https://www.eso.org/public/images/eso1907a/

  • Key parts of YouTube are written in Python. Python is one of Google's official programming languages accepted for use within the company, and YouTube is owned by Google.
  • Instagram uses Python to serve its web pages.
  • Dropbox wrote its initial server and desktop software in Python.
  • SQLMap is a tool to hack databases written in Python.
  • Disney's Toontown Online was a massively multiplayer online game written in Python.

An investment in learning Python can pay dividends because it can be used to solve a wide array of problems.

Reflection

  • What problems might you want to solve using Python?
    • Tasks you want to automate?
    • Websites you want to build?
    • Data you want to analyze?

Key Terms

  • Python: A high-level, interpreted programming language known for its readability, simplicity, and versatility. Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming. It is widely used for web development, data analysis, artificial intelligence, scientific computing, and more.
  • Python Design Philosophy: The guiding principles behind the development and evolution of the Python programming language. These principles emphasize code readability, simplicity, and explicitness. They are encapsulated in "The Zen of Python," a collection of aphorisms that capture the essence of Python's design philosophy. Examples include "Beautiful is better than ugly" and "Simple is better than complex."
  • PEP (Python Enhancement Proposal): A design document that provides information to the Python community or proposes changes to the Python language. PEPs are used to discuss new features, enhancements, and best practices. One of the most well-known PEPs is PEP 8, which outlines the style guide for Python code.