Python for TypeScript Developers
Transfer TypeScript skills to Python 3.11. Separate static types from runtime behavior, port collection and function patterns, build classes, and validate an order-processing project.
TypeScript and Python side by side
The same program in TypeScript and in Python, from the lessons of this course.
Strings Across Two Runtimes
Produce predictable text without confusing a type annotation with a value.
TypeScript1const label: string = "Ada";2// A comment is not output.3console.log(`Hello, ${label}`);Python1label = "Ada"2# A comment is not output.3print(f"Hello, {label}")Absence Without undefined
Represent absence explicitly while preserving meaningful zero values.
TypeScript1const seats: number = 0;2const reported: number | null = seats > 0 ? seats : null;3console.log(seats > 0);4console.log(reported);Python1seats = 02reported = seats if seats > 0 else None3print(seats > 0)4print(reported)From Typed Arrays to Lists
Mutate a list without replacing it with a method result.
TypeScript1const values: number[] = [2, 5];2const size: number = values.push(8);3console.log(size);4console.log(values[values.length - 1]);Python1values = [2, 5]2result = values.append(8)3print(result)4print(values[-1])Values and Half-Open Ranges
Translate a value loop without carrying over property-key iteration.
TypeScript1const values: number[] = [2, 4];2for (const value of values) console.log(value);3for (let i = 1; i < 3; i++) console.log(i);Python1values = [2, 4]2for value in values:3 print(value)4for i in range(1, 3):5 print(i)Returns and Runtime Values
Return a reusable value instead of printing inside a helper.
TypeScript1function pair(total: number): [number, number] {2 return [Math.floor(total / 10), total % 10];3}4console.log(...pair(27));Python1def pair(total):2 return total // 10, total % 103print(*pair(27))Text at the Program Boundary
Treat input as untrusted text even when the desired result is numeric.
TypeScript1const raw: string = " mug ";2const cents: number = 305;3console.log(`${raw.trim()}: ${Math.floor(cents / 100)}.${String(cents % 100).padStart(2, "0")}`);Python1raw = " mug "2cents = 3053print(f"{raw.strip()}: {cents // 100}.{cents % 100:02d}")
Syllabus
10 chapters48 lessons1 project48 challenges99 quiz questionsTypes to Python Values
6 lessonsNarrowing and Runtime Choices
5 lessonsTyped Shapes, Real Collections
5 lessonsIteration Without Type Casts
5 lessonsCalls, Defaults, and Scope
5 lessonsValidation Beyond Annotations
5 lessonsRuntime Objects and Accessors
6 lessonsContracts and Collaborators
5 lessonsProject: Order Pipeline
4 lessonsTypeScript Transfer Finals
2 lessonsFrequently asked questions
Who is Python for TypeScript Developers for?
For people who already write TypeScript and want to learn Python. Each lesson starts from TypeScript you know and shows how Python does the same thing, so you skip the beginner basics.
Do I need to know Python already?
No. The course starts with your first Python program. You need TypeScript basics: variables, conditions, loops, functions and collections.
How many lessons does Python for TypeScript Developers have?
Python for TypeScript Developers contains 48 interactive lessons you can complete at your own pace.
What does Python for TypeScript Developers cover?
The course is organized into chapters covering: Types to Python Values, Narrowing and Runtime Choices, Typed Shapes, Real Collections, Iteration Without Type Casts, and more.
Is Python for TypeScript Developers free?
Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.