Python for JavaScript Developers
Use your JavaScript knowledge to learn Python. Compare language differences, practice control flow and functions, learn object-oriented programming, and build an order-processing tool.
JavaScript and Python side by side
The same program in JavaScript and in Python, from the lessons of this course.
Print, Comments, and Strings
Print readable messages and keep comments out of program output.
JavaScript1// A note for the reader2console.log("Status:", "ready");3console.log("Don't stop");Python1# A note for the reader2print("Status:", "ready")3print("Don't stop")None, True, and False
Represent an absent value and print Python boolean results with the correct spelling.
JavaScript1let chosen = null;2const available = true;3console.log(chosen);4console.log(available);Python1chosen = None2available = True3print(chosen)4print(available)Lists Instead of Arrays
Update an ordered collection and distinguish the changed list from a method result.
JavaScript1const colors = ["red", "blue"];2const result = colors.push("green");3console.log(result);4console.log(colors[colors.length - 1]);5console.log(colors.pop());Python1colors = ["red", "blue"]2result = colors.append("green")3print(result)4print(colors[-1])5print(colors.pop())for Loops Iterate Values
Accumulate results by visiting each value in a sequence, then use a bounded range when the sequence itself is a run of integers.
JavaScript1const sizes = [2, 5, 3];2let total = 0;3for (const size of sizes) {4 total += size;5}6console.log(total);Python1sizes = [2, 5, 3]2total = 03for size in sizes:4 total += size5print(total)Define and Return
Return computed results to a caller so that one calculation can support several output formats.
JavaScript1function bounds(a, b) {2 return [Math.min(a, b), Math.max(a, b)];3}4const [low, high] = bounds(9, 3);5console.log(low, high);Python1def bounds(a, b):2 return min(a, b), max(a, b)3 4low, high = bounds(9, 3)5print(low, high)Input and Output Contracts
Turn a documented input line into values and produce exactly the output another program expects.
JavaScript1const line = " 6 4 ";2const [a, b] = line.trim().split(/\s+/).map(Number);3console.log(`${a + b} units`);Python1line = " 6 4 "2left, right = line.split()3a, b = int(left), int(right)4print(f"{a + b} units")
Syllabus
10 chapters48 lessons1 project48 challenges99 quiz questionsFrom JavaScript to Python
6 lessonsValues and Decisions
5 lessonsCollections and References
5 lessonsIteration and Transformations
5 lessonsFunctions and Scope
5 lessonsReliable Python Programs
5 lessonsObjects and Classes
6 lessonsComposition and Inheritance
5 lessonsProject: Order Processing
4 lessonsFinal Challenges
2 lessonsFrequently asked questions
Who is Python for JavaScript Developers for?
For people who already write JavaScript and want to learn Python. Each lesson starts from JavaScript 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 JavaScript basics: variables, conditions, loops, functions and collections.
How many lessons does Python for JavaScript Developers have?
Python for JavaScript Developers contains 48 interactive lessons you can complete at your own pace.
What does Python for JavaScript Developers cover?
The course is organized into chapters covering: From JavaScript to Python, Values and Decisions, Collections and References, Iteration and Transformations, and more.
Is Python for JavaScript Developers free?
Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.
Can I get a Python certificate?
Yes. Finish the matching Python journey and you'll unlock a shareable certificate. See the certifications page for details.