My first lecture: What Python (and a student) taught me4 min read

In

I have been programming for 20 years. I write Python every single day for my job. So when I had to give my first ever lecture on Python basics, I thought: “How hard can this be?”

Turns out, pretty hard.

Some Context

I work as a wissenschaftlicher Mitarbeiter (research associate) at the University of Münster, where I’m the main developer on the JupyterHub.nrw project. Part of my role also involves teaching. On April 14, 2026, my colleague Michael Wigard and I started a new course: Programming in Python for non-IT students and employees. Michael gave the first lecture, and on April 21, it was my turn.
The topics were not complicated. F-strings, if/else, for and while loops, dictionaries, and functions. Stuff I use without thinking. Stuff I could write in my sleep.

That was exactly the problem.

Knowing Something vs. Explaining Something

Because I was busy with work and some personal things (I will write a different post about it) that week, I didn’t prepare as well as I should have. I told myself it would be fine. I know this material inside out.
But here’s what I learned very quickly: knowing how to do something and knowing how to explain it to someone who has never seen it before are two completely different skills.

Programming is abstract. Almost nothing makes sense until you see it used in a real example. When you’re explaining a for loop to someone who has never written a line of code, you can’t just say “it iterates over an iterable.” You have to find the right words, the right examples, the right pace.

And that leads to a tricky question: how deep should you go? I tried to explain things thoroughly. I wanted people to really understand, not just copy what I had on the screen. But I went too deep. I ran out of time and couldn’t cover functions at all.

One thing I kept telling the students: programming is cumulative. Just like math or physics, every new concept builds on the previous one. If you don’t understand lecture one, lecture two will be harder. If you don’t understand lecture two, lecture three will feel impossible. So go back, practice, and get comfortable before moving forward.

The Moment a Student Taught Me Something

At the end of the lecture, I was explaining the while loop. A student raised his hand and asked: “Can you use else with while?”

I said no. Without hesitation. “The else keyword only exists in relation to if,” I explained confidently. “It wouldn’t make sense with while.”

But then I paused and said, “Actually, let’s just try it and see what happens.”

We tried it. And it worked.

In Python, you can attach an else block to a while loop. The else part runs when the loop finishes normally, meaning when the condition becomes False on its own, without being interrupted by a break. It looks like this:

counter = 0
while counter < 5:
    print(counter)
    counter += 1
else:
    print("Loop finished without break")

I had no idea this was possible. Twenty years of programming and I had never used or even come across while...else.

And here’s the thing: this feature is pretty much unique to Python. Most other mainstream languages like Java, JavaScript, C++, or C# don’t support else with loops. Even among experienced Python developers, many have never used it or even know it exists. So at least I’m in good company.

Here, the else might give the impression that it works like it within the else/if, however, it’s more like “if nothing interrupted the loop, do this too (what you have in the else block)

What I Took Away From This

Two things stayed with me after that lecture.

First, getting out of your comfort zone is worth it. I had never taught before. It was uncomfortable. I wasn’t as prepared as I wanted to be. But I learned more in those 90 minutes about how I understand (and don’t understand) Python than I have in months of just writing code. Teaching forces you to look at things differently.

Second, and maybe more important: stay humble. It’s not easy to stand in front of a room full of people who expect you to be the expert and then discover in real time that you were wrong about something. My first instinct was to say “no, that’s not possible.” But I’m glad I followed it up with “let’s try it.” That one moment reminded me that no matter how long you’ve been doing something, there’s always more to learn. And it reminds me of the famous saying: The more I know, the more I am aware of my ignorance.

And honestly? The students probably learned more from that moment than from anything else I said that day. They saw that it’s okay to not know everything. That being wrong is not a disaster. That curiosity beats confidence every time.

I’m already looking forward to the next lecture. This time, I’ll prepare better. But I also know now that no amount of preparation will make me know everything. And that’s perfectly fine.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Peshmerge.io-logo
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.