Menu
CoddyTech
Course

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.

  1. Strings Across Two Runtimes

    Produce predictable text without confusing a type annotation with a value.

    TypeScript
    1const label: string = "Ada";2// A comment is not output.3console.log(`Hello, ${label}`);
    Python
    1label = "Ada"2# A comment is not output.3print(f"Hello, {label}")
  2. Absence Without undefined

    Represent absence explicitly while preserving meaningful zero values.

    TypeScript
    1const seats: number = 0;2const reported: number | null = seats > 0 ? seats : null;3console.log(seats > 0);4console.log(reported);
    Python
    1seats = 02reported = seats if seats > 0 else None3print(seats > 0)4print(reported)
  3. From Typed Arrays to Lists

    Mutate a list without replacing it with a method result.

    TypeScript
    1const values: number[] = [2, 5];2const size: number = values.push(8);3console.log(size);4console.log(values[values.length - 1]);
    Python
    1values = [2, 5]2result = values.append(8)3print(result)4print(values[-1])
  4. Values and Half-Open Ranges

    Translate a value loop without carrying over property-key iteration.

    TypeScript
    1const values: number[] = [2, 4];2for (const value of values) console.log(value);3for (let i = 1; i < 3; i++) console.log(i);
    Python
    1values = [2, 4]2for value in values:3    print(value)4for i in range(1, 3):5    print(i)
  5. Returns and Runtime Values

    Return a reusable value instead of printing inside a helper.

    TypeScript
    1function pair(total: number): [number, number] {2  return [Math.floor(total / 10), total % 10];3}4console.log(...pair(27));
    Python
    1def pair(total):2    return total // 10, total % 103print(*pair(27))
  6. Text at the Program Boundary

    Treat input as untrusted text even when the desired result is numeric.

    TypeScript
    1const raw: string = "  mug  ";2const cents: number = 305;3console.log(`${raw.trim()}: ${Math.floor(cents / 100)}.${String(cents % 100).padStart(2, "0")}`);
    Python
    1raw = "  mug  "2cents = 3053print(f"{raw.strip()}: {cents // 100}.{cents % 100:02d}")

Syllabus

10 chapters48 lessons1 project48 challenges99 quiz questions

TypeScript Transfer Finals

2 lessons

More courses for TypeScript developers

Learn Python from another language

Frequently 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.

Coddy programming languages illustration

Start Python for TypeScript Developers for free

Get started