Menu
CoddyTech
Course

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.

  1. 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…

    Kotlin
    1fun main() {2    val name = "Ada"3    println("Hi $name!")4}
    Python
    1name = "Ada"2print(f"Hi {name}", "!")
  2. 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…

    Kotlin
    1fun main() {2    val seats: Int? = null3    println(seats == null)4    println(false)5}
    Python
    1data = {"seats": None}2print(data["seats"] is None)3print("seats" in data)
  3. 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…

    Kotlin
    1fun main() {2    val items = mutableListOf(4, 8)3    println(items.add(12))4    println(items.last())5}
    Python
    1items = [4, 8]2print(items.append(12))3print(items[-1])
  4. 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…

    Kotlin
    1fun main() {2    println((2..5).joinToString(" "))3}
    Python
    1values = [2, 4]2for value in values:3    value += 14print(*values)
  5. 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…

    Kotlin
    1fun addItem(items: MutableList<Int>) { items.add(9) }2fun main() {3    val items = mutableListOf(1)4    addItem(items)5    println(items.size)6}
    Python
    1def add_item(items):2    items.append(9)3items = [1]4add_item(items)5print(len(items))
  6. 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…

    Kotlin
    1import 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}
    Python
    1label = " Green tea ".strip()2cents = 3053print(f"{label}: {cents / 100:.2f}")

Syllabus

10 chapters48 lessons1 project48 challenges99 quiz questions

Apply Your Kotlin Experience

2 lessons

More courses for Kotlin developers

Learn Python from another language

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

Coddy programming languages illustration

Start Python for Kotlin Developers for free

Get started