Skip to content

nazmulxdev/py-for-js-devs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐍 Python – Zero to Advanced

🌐 Learning Goal

Master Python completely β€” from first program to advanced patterns β€” with every concept compared side-by-side to JavaScript so you learn twice as fast.


🎯 Who Is This For?

Developers who already know JavaScript / Node.js and want to learn Python quickly by mapping what they already know.


πŸ› οΈ Prerequisites

  • Basic understanding of JavaScript (variables, functions, loops, classes)
  • Node.js installed (for JS comparisons)
  • Python 3.10+ installed
# Verify both are installed
node --version     # JS runtime
python3 --version  # Python runtime

πŸ“ Lesson Files

python-lessons/
β”œβ”€β”€ README.md                    ← You are here (master index)
β”‚
β”œβ”€β”€ 01_setup.md                  ← Installation, REPL, first program
β”œβ”€β”€ 02_variables.md              ← Variables, types, type conversion
β”œβ”€β”€ 03_strings.md                ← Strings, f-strings, all methods
β”œβ”€β”€ 04_numbers.md                ← Numbers, math operators, math module
β”œβ”€β”€ 05_control_flow.md           ← if/elif/else, loops, break/continue
β”œβ”€β”€ 06_lists.md                  ← Lists, slicing, comprehensions
β”œβ”€β”€ 07_tuples.md                 ← Tuples, packing, unpacking
β”œβ”€β”€ 08_dictionaries.md           ← Dicts, methods, dict comprehensions
β”œβ”€β”€ 09_sets.md                   ← Sets, operations, use cases
β”œβ”€β”€ 10_functions.md              ← def, args, kwargs, lambda, scope
β”œβ”€β”€ 11_decorators.md             ← @decorator, closures, functools
β”œβ”€β”€ 12_generators.md             ← yield, generator expressions, lazy eval
β”œβ”€β”€ 13_oop_basics.md             ← Classes, __init__, self, methods
β”œβ”€β”€ 14_oop_advanced.md           ← Inheritance, magic methods, dataclass
β”œβ”€β”€ 15_modules.md                ← import, packages, __name__
β”œβ”€β”€ 16_pip_venv.md               ← pip, virtual environments, requirements
β”œβ”€β”€ 17_file_handling.md          ← open(), read, write, with statement
β”œβ”€β”€ 18_error_handling.md         ← try/except/finally, custom exceptions
β”œβ”€β”€ 19_json_csv.md               ← json module, csv module
β”œβ”€β”€ 20_stdlib.md                 ← os, sys, pathlib, datetime, random, re
β”œβ”€β”€ 21_type_hints.md             ← Type annotations, typing module, mypy
β”œβ”€β”€ 22_async.md                  ← async/await, asyncio, httpx
β”œβ”€β”€ 23_regex.md                  ← re module, patterns, match/search/sub
β”œβ”€β”€ 24_collections.md            ← Counter, defaultdict, deque, namedtuple
β”œβ”€β”€ 25_testing.md                ← pytest, assertions, fixtures, mocking
└── 26_best_practices.md         ← PEP 8, clean code, tools

πŸ“Š Curriculum Phases

Phase 1 β€” Fundamentals (Lessons 01–04)

Get Python running and understand the basic building blocks.

Phase 2 β€” Control Flow (Lesson 05)

Make decisions and repeat operations.

Phase 3 β€” Data Structures (Lessons 06–09)

Python's powerful built-in collections.

Phase 4 β€” Functions (Lessons 10–12)

Write reusable, expressive, Pythonic functions.

Phase 5 β€” OOP (Lessons 13–14)

Design programs with classes and objects.

Phase 6 β€” Modules & Ecosystem (Lessons 15–16)

Organise code and use Python's massive library ecosystem.

Phase 7 β€” File & Error Handling (Lessons 17–19)

Read files, process data, handle failures.

Phase 8 β€” Advanced Python (Lessons 20–24)

Standard library, type hints, async, regex, collections.

Phase 9 β€” Testing & Best Practices (Lessons 25–26)

Write code that works, lasts, and others can read.


πŸ” JS vs Python β€” Quick Mental Map

JavaScript Python Notes
let / const just = No declaration keyword
console.log() print() Output
null None No value
true / false True / False Capital letters!
=== == Python has no ===
{} blocks indentation 4 spaces = block
Array list Most methods differ
Object dict Keys must be quoted
function / => def / lambda
class + constructor class + __init__
this self Must be explicit
try/catch try/except
...spread *args / **kwargs
async/await async/await + asyncio
Template literals f-strings f"Hello {name}"

πŸš€ Setup Instructions

1️⃣ Install Python

# Download from https://python.org
python3 --version   # verify

2️⃣ Install a Code Editor

VS Code + Python extension (IntelliSense, linting, debugging)

3️⃣ Create Virtual Environment

python3 -m venv venv
source venv/bin/activate    # Mac/Linux
venv\Scripts\activate       # Windows

4️⃣ Run Your First File

echo 'print("Hello, World!")' > hello.py
python3 hello.py

βœ… Lesson Conventions

Each lesson file follows this structure:

🎯 What you'll learn
πŸ“Œ JS vs Python comparison (side by side)
πŸ’‘ Key concepts explained
πŸ§ͺ Code examples with output
⚠️  Common mistakes / gotchas
πŸ”— What to learn next

About

🐍 Learn Python fast if you already know JS. 26 lessons with side-by-side JS vs Python comparisons β€” variables, OOP, async, decorators, regex & best practices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors