Menu
CoddyTech
Course

Kotlin for Python Developers

Move from Python to Kotlin through null safety, collection ownership, functions, properties and object contracts. Build a connected multi-file order processor and port a stock ledger.

Python and Kotlin side by side

The same program in Python and in Kotlin, from the lessons of this course.

  1. Strings and Templates

    Python f-strings mark interpolation with an f prefix and braces. Kotlin uses dollar templates inside ordinary strings. Python executes module-level statements when a module runs or imports, whereas this Kotlin runner invokes one top-level main. Supporting…

    Python
    1ready = 32print(f"Ready: {ready}")
    Kotlin
    1fun main(){2val ready=33println("Ready: $ready")4}
  2. Equality and Identity

    Python == delegates to value equality and is tests object identity. Kotlin == likewise uses equality semantics, while === tests reference identity. Python lists compare element values by default; Kotlin arrays need contentEquals rather than ordinary array ==…

    Python
    1a = "".join(["t", "e", "a"])2print(a == "tea")
    Kotlin
    1fun main(){2val a=String(charArrayOf('t','e','a'))3val b=String(charArrayOf('t','e','a'))4println(a==b)5}
  3. Arrays and IntArray

    Python lists grow and allow negative indexes. Kotlin Array and IntArray are fixed-size and reject negative indexes. Use last or a valid size-based index to express end access, and MutableList when growth is required. Python slices also create new lists, while…

    Python
    1values = [4, 8, 12]2print(values[-1])
    Kotlin
    1fun main(){2val a=intArrayOf(4,8,12)3println(a.last())4}
  4. While, Break, and Continue

    Python for and while support else clauses that run when the loop finishes without break. Kotlin has no loop-else syntax; track the needed condition explicitly. Both languages distinguish continue from break. This demonstration skips a blank word and breaks at…

    Python
    1kept = []2for word in ["tea", "", "STOP", "coffee"]:3    if word == "STOP":4        break5    if not word:6        continue7    kept.append(word)8print(",".join(kept))
    Kotlin
    1fun main(){2val kept=mutableListOf<String>()3for(word in listOf("tea","","STOP","coffee")){if(word=="STOP")break;if(word.isEmpty())continue;kept.add(word)}4println(kept.joinToString(","))5}
  5. Top-level Functions

    Python functions may be module-level and use positional or keyword arguments. Kotlin also allows top-level functions, but its declarations have static parameter types. Python returning None implicitly differs from a Kotlin non-Unit function, which needs a…

    Python
    1def is_long(text: str) -> bool:2    return len(text) > 43
    4print(is_long("coffee"))
    Kotlin
    1fun isLong(text:String):Boolean = text.length>42fun main(){3println(isLong("coffee"))4}
  6. Input and String Formatting

    Python strip and upper provide familiar normalization operations, but Python string length counts Unicode code points rather than JVM Kotlin UTF-16 code units. Grapheme clusters require a further text model in either language. ASCII examples keep these…

    Python
    1print("  tea  ".strip().upper())
    Kotlin
    1fun main(){2println("  tea  ".trim().uppercase(java.util.Locale.ROOT))3}

Syllabus

10 chapters48 lessons1 project48 challenges99 quiz questions

Final Challenges

2 lessons

More courses for Python developers

Learn Kotlin from another language

Frequently asked questions

Who is Kotlin for Python Developers for?

For people who already write Python and want to learn Kotlin. Each lesson starts from Python you know and shows how Kotlin does the same thing, so you skip the beginner basics.

Do I need to know Kotlin already?

No. The course starts with your first Kotlin program. You need Python basics: variables, conditions, loops, functions and collections.

How many lessons does Kotlin for Python Developers have?

Kotlin for Python Developers contains 48 interactive lessons you can complete at your own pace.

What does Kotlin for Python Developers cover?

The course is organized into chapters covering: Starting Kotlin, Values and Decisions, Collections and Ownership, Iteration and Transformations, and more.

Is Kotlin for Python 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 Kotlin for Python Developers for free

Get started