You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Python is one of the most popular programming languages in the world. Created by Guido van Rossum and first released in 1991, Python was designed with readability in mind — its syntax is clean, consistent, and close to plain English.
Python is used across a huge range of fields:
Python follows a set of guiding principles sometimes called "The Zen of Python." A few key ideas:
These principles make Python code easy to read, write, and maintain.
Python programs are text files with a .py extension. The classic first program looks like this:
print("Hello, World!")
Running this program outputs:
Hello, World!
The built-in print function displays output to the screen. You pass it a string (text enclosed in quotes), and it prints that text followed by a newline.
Python is an interpreted language. Rather than compiling your code to machine code before running it, Python reads and executes your source file line by line at runtime through the Python interpreter.
This means:
There are two major lines: Python 2 (now end-of-life) and Python 3 (current). All new projects should use Python 3. This course uses Python 3 throughout.
You can run Python in several ways:
# Interactive REPL — type python3 in your terminal
>>> 2 + 2
4
>>> print("Hello")
Hello
Or save a file and run it:
# Save as hello.py then run: python3 hello.py
print("Hello, World!")
Python's simplicity and power make it an excellent first language and a valuable tool throughout your career. Let's dive in!