A computer program is a sequence of instructions to be executed by a computer to perform one or more tasks. The term code is often used to refer to some or all of the instructions within a computer program. Programming refers to the act of writing a computer program.
A programming language is a collection of keywords and syntactical rules that can be used to write the instructions contained within a computer program. There are many different programming languages available today. Some of the most popular languages today are C++, Java, Python, R, Javascript, Scala, and PHP. Some languages are designed to focus on or excel at specific types of tasks, while others are considered to be "general-purpose" languages that can be used for almost any programming task. The languages are created with different design philosophies in mind, and they each have their own strengths and weaknesses.
While there are many important differences between programming languages, most languages also have a lot of similarities. Once you learn how to program in one language, you will have a good understand of how a programming language is structured, and you should find it much easier to learn additional languages in the future.
Python is a general-purpose programming language designed by Guido van Rossum and first released to the public in 1991. Python was designed to be relatively easy to learn, and to be easily readable. It is freely available, and has an active community of developers who freely distribute third-party libraries that can be used to extend the functionality of Python. It is not the fastest programming language. Programs written in Java or C++ will likely run much more quickly than a similar program written in Python. Never-the-less, Python is currently the fastest-growing programming language because of its ease-of-use and active community of developers, among other reasons.
A programming environment is a set of tools that are used to write and execute computer programs. Every Python environment will include a Python interpreter, which is a program that executes commands that are written in the Python language. Lines of Python code can be provided directly to an interpreter one-at-a-time through a console or terminal application, but it usually more convenient to create a file that contains several lines of code and then provide the file to the interpreter for execution. It is possible to write Python code in a simple text editor such as Notepad, but it is more common to use an integrated development environment, or IDE. And IDE is a set of tools used to write, manage, and debug code. An IDE will contain an editor used to write code, but will also contain additional features designed specifically to assist with writing code. Most IDEs will also connect directly to the interpreter so that you can submit your code to be ran directly from the IDE itself. When working in an IDE, it is easy to forget that the interpreter exists, but it is important to remember that there is another program in the background that is actually executing your code.
A Python script is a simple plain-text file that contains lines of Python code. Some of the most popular IDEs for writing Python scripts are PyCharm, Spyder, Atom, and Thonny. Traditionally, most Python programs have been written as scripts.
A modern alternative to a script-based IDE is Jupyter Notebook. Instead of plain-text scripts, Jupyter uses a notebook format that allows for code to be presented alongside formatted text. A notebook consists of multiple cells of various types. Markdown cells contain formatted text, images, embedded videos, links, and other types of content. Code cells contain lines of Python code that can be executed within the notebook. If a particular code cell generates output, then that output will be displayed directly beneath the cell. Notebooks are useful for creating presentations and reports that contain executable code along with formatted text and other media. The Jupyter Notebook environment has become particularly prominent within the Data Science community.
The Anaconda Distribution is a collection of bundled software designed to help you quickly set up with a Python environment. The distribution includes Python, Spyder, and Jupyter, as well as several other tools that we have not yet discussed. We will be using the Anaconda distribution in this class, since it is perhaps the easiest way to quickly get up and running.
Instructions for installing Anaconda are provided below.
Please following the instructions below to install the Anaconda distribution.
conda update --all