What is Python?
A friendly intro to Python and why it's loved worldwide.
Most programming languages were designed for computers. Python was designed for humans.
Guido van Rossum created it with one goal: make code that reads like English and gets out of your way. The result? Netflix serves 260 million users with it. Instagram runs on it. NASA uses it for space exploration. Readable code turns out to be maintainable code — and that matters.
Here's a complete Python program:
print('Hello, world!')Hello, world!print() is Python's way of displaying text on the screen. Whatever you put inside the parentheses — wrapped in quotes — gets shown as output. That's it.
One line. No class, no main method, no imports. Compare that to Java's 7 lines of boilerplate just to say hello. Python removes the ceremony so you focus on the actual problem.
Now that you know print() displays text, what does this program output?
print('Line 1')
print('Line 2')- ALine 1 Line 2
- BLine 1 Line 2
- CLine 1Line 2
- DError
Python's most distinctive rule: indentation defines code blocks.
In Java or C, blocks use {}. In Python, consistent spacing (4 spaces is standard) is the syntax — not just style:
if True:
print('inside the block') # 4 spaces indent
print('outside') # no indentMix up the indentation and Python raises an IndentationError. This forces clean, readable structure into every program.
Python indentation is part of the syntax. What happens if your indentation is inconsistent?
- APython ignores it
- BYou get a style warning only
- CPython raises an IndentationError
- DThe code runs but may behave unexpectedly
Python's reach is broad:
- Web development — Instagram and Pinterest are built on Django (a Python framework)
- Data science — NumPy, Pandas, Matplotlib are the industry standard
- AI & machine learning — TensorFlow, PyTorch, scikit-learn all use Python
- Automation — scripting, scraping, testing pipelines
It's the most popular first language because it's clear — but it's also what professionals ship to production. You're learning a real tool.
Which domain is Python NOT commonly used for?
- AWeb development
- BMachine learning
- CWriting operating system kernels
- DData analysis
Python ignores everything after a certain symbol on a line. That's a comment.
speed = 120 ___ this is too fastWhat symbol starts the comment?