First Semester at UET — Learning Python From Absolute Zero
How I learned Python and its basics before midterms in my first semester at UET Faisalabad — starting from absolutely nothing.
Before I came to UET Faisalabad, my relationship with computers was entirely that of a user. I knew how to browse the internet, use applications, watch videos, and manage files. What happened inside the machine — how software actually worked, how instructions were written and executed, how a blank screen became a functioning program — was completely invisible to me. Computer Engineering was supposed to change that, and it did, but not gently. The first subject that pulled back the curtain was Programming Fundamentals, and the language we used to do it was Python. What followed over the next several weeks before midterms was the most intellectually demanding and genuinely exciting learning experience I had encountered up to that point in my life.
Python was presented to us not as a tool for experts but as a starting point — a language designed to be readable, to behave predictably, and to let beginners focus on learning programming concepts rather than fighting with complicated syntax. I appreciated that framing in theory. In practice, even a beginner-friendly language has a learning curve when you have never written a single line of code before. The first programs I wrote were simple to the point of feeling trivial — printing text to the screen, storing a name in a variable, adding two numbers together — but getting them to work correctly required a precision I was not used to. Python does not tolerate imprecision. A missing colon, an indentation error, a variable name spelled differently from how it was defined — any of these would stop the program entirely and produce an error message that I had to learn to read and interpret.
Reading error messages is itself a skill, and it is one that took me time to develop. My first instinct when I saw an error was panic followed by random changes — deleting things, retyping things, hoping that something would accidentally fix the problem. That approach occasionally worked by chance, but it never produced understanding. What actually helped was slowing down, reading the error carefully, identifying the line it pointed to, and thinking logically about what the code was doing versus what I intended it to do. That process — read the error, locate the problem, understand why it happened, fix it deliberately — is the actual debugging workflow that professional developers use, and I was learning it in those first frustrated sessions with Python.
Variables and data types were the foundational concepts that everything else was built on. A variable is a name that refers to a value stored in the computer’s memory — a container that holds information your program can use and modify. Data types determine what kind of information a variable holds: integers for whole numbers, floats for decimals, strings for text, booleans for true-or-false values. These distinctions matter because operations that work on one type do not work on another. You can multiply two integers, but you cannot multiply two strings. You can check whether a boolean is true, but you cannot do arithmetic on it. Python enforces these distinctions strictly, and learning to think in terms of types — to always know what kind of data you are working with — was one of the first real mental habits that programming instilled in me.
Conditional statements arrived next and introduced a different kind of thinking. An if statement asks a question about the state of the program and executes different code depending on the answer. If this condition is true, do this. If it is false, do something else. Or check another condition. Or do nothing. The logic is simple in principle, but writing conditions correctly requires you to be precise about what you actually want to check and what the program should do in every possible case. I wrote a grade classifier — a program that took a numerical score and printed the corresponding letter grade — and discovered that the order of my conditions mattered, that I had not handled the case where a score was exactly on the boundary between two grades, that my program behaved incorrectly for negative numbers even though negative scores were impossible in reality. Finding and fixing those problems taught me more about conditional logic than any explanation of the concept could have.
Loops were where I first felt the genuine power of programming. A loop is an instruction to repeat a block of code — either a fixed number of times, or until a condition changes. A for loop iterates over a sequence: for each item in this list, do this. A while loop keeps running as long as a condition remains true: while this is still the case, keep doing this. The ability to repeat an operation thousands of times without writing it thousands of times is one of the things that makes computers fundamentally different from humans as tools for computation, and loops are how you access that ability. I wrote programs that generated multiplication tables, that counted through sequences, that searched for patterns in numbers — all things that would be tedious or impossible to do manually but that a loop handles effortlessly.
Functions came later in those pre-midterm weeks and brought a new kind of structure to my programs. A function is a named block of code that performs a specific task and can be called by name from anywhere in the program. Instead of writing the same logic repeatedly in different places, you write it once in a function and call that function whenever you need it. Functions take inputs — parameters — and produce outputs — return values. They make programs modular, readable, and easier to debug, because when something goes wrong you can identify which function is responsible and fix it in one place. Writing my first set of functions, organizing a small program into clearly named pieces that each did one thing well, gave me a first glimpse of what good code structure actually looks like.
By the time midterms arrived, I had written more programs than I could easily count — small, focused exercises that each targeted a specific concept. None of them were impressive in isolation. Together, they represented something real: a foundation of practical experience with a programming language, built through repetition and incremental challenge, that would support everything that came after it in the semester and beyond. I did not feel like a programmer yet. But I had started thinking like one, and that was the most important thing that first semester of Python gave me.
Programming fundamentals are the foundation of everything that follows in Computer Engineering. For a perspective on where those foundations lead in research and applied AI, visit Dr. Bilal Ahmad’s Google Scholar profile.