Python for Kotlin Developers
Transfer Kotlin experience to Python: compare values, control flow, collections, functions, and object behavior. Build a connected multi-file order processor and port an inventory program.
Kotlin and Python side by side
The same program in Kotlin and in Python, from the lessons of this course.
Print and String Templates
Kotlin println takes one value, while Python print accepts multiple positional values and inserts spaces. Python strings need an f prefix to evaluate expressions in braces; ordinary strings leave dollar signs untouched. Kotlin has a distinct Char type for…
Kotlin1fun main() {2 val name = "Ada"3 println("Hi $name!")4}Python1name = "Ada"2print(f"Hi {name}", "!")Nullable Types and None
Kotlin distinguishes nullable types such as Int? from Int and offers safe calls and Elvis fallback. Python None represents absence without a compile-time nullable-type boundary. Test it with is None before using operations that require a value. Python…
Kotlin1fun main() {2 val seats: Int? = null3 println(seats == null)4 println(false)5}Python1data = {"seats": None}2print(data["seats"] is None)3print("seats" in data)Read-only Lists and Mutation
Kotlin separates List and MutableList interfaces; a read-only view is not necessarily a deeply immutable object. Python's ordinary list exposes mutation directly and can contain objects of different types. Python negative indexes count from the end, unlike…
Kotlin1fun main() {2 val items = mutableListOf(4, 8)3 println(items.add(12))4 println(items.last())5}Python1items = [4, 8]2print(items.append(12))3print(items[-1])Ranges and Loop Bindings
Kotlin's 2..5 range includes five; Python range(2, 5) excludes five. Kotlin until also excludes its upper bound. Both basic for forms visit iterable values rather than expose writable list slots. Python loop names can be rebound, but rebinding an integer loop…
Kotlin1fun main() {2 println((2..5).joinToString(" "))3}Python1values = [2, 4]2for value in values:3 value += 14print(*values)Functions and Shared Lists
Kotlin fun becomes Python def. A block-bodied Python function needs return to send a value back; falling off the end returns None rather than Kotlin Unit. Both languages can mutate a passed mutable list through a parameter. Kotlin parameters cannot be…
Kotlin1fun addItem(items: MutableList<Int>) { items.add(9) }2fun main() {3 val items = mutableListOf(1)4 addItem(items)5 println(items.size)6}Python1def add_item(items):2 items.append(9)3items = [1]4add_item(items)5print(len(items))Console Input and Formatting
Kotlin readln and Python input return a line of text without its line terminator. Parse numeric input explicitly. Python strip removes surrounding whitespace; internal spaces remain. F-strings can format decimal places, analogous to JVM String.format with a…
Kotlin1import java.util.Locale2fun main() {3 val label = " Green tea ".trim()4 val cents = 3055 println(String.format(Locale.ROOT, "%s: %.2f", label, cents / 100.0))6}Python1label = " Green tea ".strip()2cents = 3053print(f"{label}: {cents / 100:.2f}")
Syllabus
10 chapters48 lessons1 project48 challenges99 quiz questionsFrom Kotlin to Python
6 lessonsValues and Decisions
5 lessonsCollections and Shared State
5 lessonsIteration and Transformations
5 lessonsFunctions and Closures
5 lessonsInput, Errors, and Modules
5 lessonsInstances and Shared State
6 lessonsComposition and Dispatch
5 lessonsProject: Order Processing
4 lessonsApply Your Kotlin Experience
2 lessonsFrequently asked questions
Who is Python for Kotlin Developers for?
For people who already write Kotlin and want to learn Python. Each lesson starts from Kotlin 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 Kotlin basics: variables, conditions, loops, functions and collections.
How many lessons does Python for Kotlin Developers have?
Python for Kotlin Developers contains 48 interactive lessons you can complete at your own pace.
What does Python for Kotlin Developers cover?
The course is organized into chapters covering: From Kotlin to Python, Values and Decisions, Collections and Shared State, Iteration and Transformations, and more.
Is Python for Kotlin Developers free?
Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.