Hi everyone 👋
I am learning Python in an online class with Muthu Sir (Payilagam). Today was Day 1. No loops yet, no big programs. Today Sir explained what Python is and why we should learn it. Here are my notes, in the same order Sir taught them.
1. The Problem: So Many Languages. Why Python?
There are many programming languages: Java, JavaScript, PHP, Ruby... So why start with Python?
Sir's answer: Python is an easy language. It has easy syntax.
And before we started, Sir gave us one ground rule:
Unmute and discuss.
The class is not only for listening. We should talk, ask and discuss.
2. What is Python?
Python is a General Purpose, High Level Programming Language.
Sir showed us the five lines from the Python website:
| Python is... | What Sir said it means |
|---|---|
| powerful... and fast | Works with huge data: Data Science, Analytics, Machine Learning, AI |
| plays well with others | Desktop apps, Web apps (Django, Flask), DB apps (DB connection), Network programming (scripting), Games, Internet of Things |
| runs everywhere | All platforms: Windows, Linux, Mac |
| friendly & easy to learn | Easy syntax |
| Open | Open source |
"Plays well with others": Python with other languages
| Name | Python + |
|---|---|
| CPython | Python with C |
| Jython (JPython) | Python with Java |
| IronPython | Python with C# .NET |
| PyPy | Another Python implementation |
Python files use the .py extension.
3. Where Do We Run Python?
We use a Command Prompt (Windows) or a Terminal (Linux / Mac).
- On Linux, Python is already installed.
- On Windows, we install it. (A few friends needed help with the installation.)
- To start Python we type
pythonorpython3. - Python also comes with IDLE, a small editor.
Sir also talked about the installation directory: the OS keeps each language in a folder, and Python has its own location (path).
My first Python code: who made Python?
import sys
print(sys.copyright)
On my laptop (Python 3.10) the output was:
Copyright (c) 2001-2023 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.
(The years in the first line change with your Python version.) Look at the last line: 1991. That is when Python started!
4. High Level vs Low Level Languages
| High Level | Low Level | |
|---|---|---|
| Who understands it easily? | Humans | Machines |
| Examples | Python, JS, Java, C# | Assembly language, Binary |
| Looks like |
print(), echo()
|
MOV AL, 10 or 10 11000
|
Sir also told us: everything a computer handles (text, audio, video, images) finally becomes numbers, and then binary.
Same job, two levels
High level (Python):
no1 = 10
no2 = 20
print(no1 + no2)
🤔 Guess the output before you read further...
Output:
30
Low level (Assembly, for a microprocessor / microcontroller):
MOV AL, 10
MOV BL, 15
ADD AL, BL
Dry run of the assembly code
| Step | Instruction | AL | BL |
|---|---|---|---|
| 1 | MOV AL, 10 |
10 | - |
| 2 | MOV BL, 15 |
10 | 15 |
| 3 | ADD AL, BL |
25 | 15 |
The Python version reads almost like English. The assembly version is close to machine instructions. That is why Python is called high level.
5. Python History and Versions
| Year | Event |
|---|---|
| 1991 | Python released |
| 1994 | Python version 1 |
| 1995 | Java released |
| 2000 | Python version 2 |
| December 2008 | Python version 3 |
Earlier, upgrades were small steps like 1.1 → 1.2 → 1.3.
Backward Compatibility
Sir explained compatibility with numbers:
- Version 3 should run what worked in version 2.
- Version 10 should run what worked in version 8.
A new version working with old code is called backward compatibility. Python 2 → Python 3 was a big change, and old Python 2 code does not always run in Python 3. That is why people talk about "Python vs Python 3". Today we learn Python 3.
Sir also compared this with Java: Java 7 came on July 7, 2011, and Java 8 came on March 18, 2014. Java was made by Sun Microsystems, and now it is with Oracle (and there is OpenJDK). Sir talked about corporate-driven vs community-driven languages.
6. Programming Language vs Scripting Language
All scripting languages are programming languages.
The difference is in translation: how our code becomes machine code.
| Translation | How | Type |
|---|---|---|
| Compilation | Whole program translated at once | Compiled language → Programming language |
| Interpretation | Line by line translation | Interpreted language → Scripting language |
Python can be used both ways:
- Scripting: small scripts, task automation (clock → alarm, anti-virus)
- Programming: standalone applications (calculator, notepad), Python modules (user defined modules)
7. Programming Paradigms
Paradigm = a style of writing programs.
- POP: Procedure Oriented Programming
- OOP: Object Oriented Programming
- FP: Functional Programming
- MP: Modular Programming
Sir mentioned older languages too: FORTRAN, COBOL, C, C++, PHP, and Java (good for performance and security).
Python supports many paradigms (multi-paradigm): FP, OOP, POP, MP.
8. Features of Python ✅
- Python is simple
- Python is open
- Python is an interpreted language
- Python is extensible (CPython / Jython / PyPy)
- High level programming language
- Platform independent
- Dynamically typed language
9. Limitations of Python ❌
- Performance is low compared to C, C++ and Java
- Memory consumption is high
- Runtime errors: type related errors
- Not for mobile app development
Every language has good points and weak points. We should know both.
10. Homework 📝
Sir asked us to publish our notes on dev.to. It is like Facebook, but for developers. So this blog is my homework! 😊
What I Learned Today
- Python is a general purpose, high level programming language with easy syntax.
- High level = easy for humans; low level (assembly, binary) = close to the machine.
- Compilation translates the whole program; interpretation translates line by line.
- Python 1 (1994), Python 2 (2000), Python 3 (2008). Python 3 is not fully backward compatible with Python 2.
- Python has 7 features (simple, open, interpreted, extensible, high level, platform independent, dynamically typed) and limitations (speed, memory, runtime type errors, mobile apps).
Thank you, Muthu Sir! 🙏
Top comments (0)