You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
What is Python?
What is Python?
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.
Why Python?
Python is used across a huge range of fields:
- Web development — frameworks like Django and Flask power millions of sites
- Data science and machine learning — libraries like NumPy, Pandas, and TensorFlow
- Automation and scripting — quick scripts to automate repetitive tasks
- DevOps and cloud — infrastructure tools, AWS Lambda functions, and more
- Education — the most commonly taught first language at universities worldwide
Python's Design Philosophy
Python follows a set of guiding principles sometimes called "The Zen of Python." A few key ideas:
- Readability counts — clear code is better than clever code
- Simple is better than complex — prefer straightforward solutions
- There should be one obvious way to do it — consistency over flexibility
These principles make Python code easy to read, write, and maintain.
Your First Python Program
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.
How Python Runs
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:
- No separate compile step — just write and run
- Errors appear at runtime as you test
- Great for quick experimentation via the interactive REPL (Read-Eval-Print Loop)
Python Versions
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.
Running Python
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!