Code › codeit-ai-sprint

Revisiting Python in the Pre-Course

A short note from the Codeit AI Engineer Sprint pre-course on reviewing Python basics, PEP 8, and scope

I finished two of the three pre-course modules for the Codeit AI Engineer Sprint. Each module included small exercises and quizzes, which made it easier to check whether I was actually following along.

The first one was an introduction to Python. It covered what Python is, how to run the first bit of code, and basic ideas like variables, data types, functions, parameters, and return. The second one went a little deeper into data types, abstraction, and control flow, including numbers, strings, type conversion, f-string, booleans, variable scope, while, if, and elif.

Most of it was a review, but I did not want to just skip through it. Even when the concept is familiar, each language handles small details differently. Type conversion, for example, looks ordinary from the outside, but the actual behavior changes from language to language. It was useful to line those things up again from Python’s side.

The part that stayed with me most was PEP 8. When I learned languages like C++ before, I do not remember meeting an official style guide early in the learning process. I mostly picked up what people used in the field, or followed whatever convention the team or codebase already had. Python felt different because PEP 8 appears early as a shared reference point.

Variables and functions use snake_case, classes use PascalCase, and constants use UPPER_SNAKE_CASE. There are also conventions around indentation, import order, and whitespace. The syntax itself was not the interesting part. What felt useful was seeing the shape Python code is expected to have.

I also looked again at variable scope. In TypeScript, let and const create block scope, but Python does not create a new scope for if, for, or while blocks. Functions are the important boundary. One detail that caught my attention was that if a name is assigned inside a function, Python treats it as a local variable even if the same name exists globally.

To modify a global value, Python needs the global keyword. The course did not go deeply into that, so I looked it up separately. I probably will not use it often, but it helped me understand how Python decides what a variable name means.

The exercises were basic, but typing them out myself was still helpful. If I only watch the lesson, it is easy to pass over the material as something I already know. Once I write variable names, define functions, and use conditionals by hand, the Python rhythm starts to come back a little.

I plan to take the remaining pre-course module with the same mindset. I want to make the Python basics a little more precise before the course moves into AI, LLMs, and MLOps, where I will keep reading and writing Python code anyway. Well, the agents may write a lot of it. But I still need to read it properly.