You will learn by directly typing everything from running Python for the first time to data containers like variables, lists, and dictionaries, flow control such as conditional statements, loops, and functions, and even how to read errors (tracebacks).
S3-01 Starting Python: Talking to the Computer
Python is the language closest to human speech, making it perfect for 'reading code written by AI.' The first command, print, is the 'computer's mouth' that displays text on the screen. You will display your name and a greeting, and see how the output changes when you change the text.
S3-02 Variables and Data Types: Labeled Boxes for Storing Values
Variables are boxes with name tags, and data types represent the kinds of values (text, integers, decimals, booleans). To a computer, the number 21 and the text ‘21’ are completely different, so make it a habit to check the type using type().
S3-03 List: A single-row box for storing values in a sequence
A list is like an egg carton with multiple compartments. The key point is that the index starts from 0 and -1 represents the very last item. Try running len(counting) and append(adding) yourself.
S3-04 Dictionary: A Locker Accessed by Name Tags
If lists retrieve items by number, dictionaries retrieve values using meaningful labels (keys). Using names instead of numbers makes the code readable at a glance. Grasp the difference: "Lists use numbers, dictionaries use names."
S3-05 Reading Conditionals: If this happens, do this
Conditional statements are like traffic lights, choosing a path based on the situation. Python uses indentation to mark blocks of code, so if the indentation is wrong, the behavior changes. We practice "predicting results before execution" by determining grades based on scores.
S3-06 Reading Loops: One by One, Until the End
A loop is like a conveyor belt that takes values one by one to repeat the same task. Whether there are 100 or 1,000 values, you only need to write the task once. Follow the process of the total accumulating through an accumulation variable with your eyes.
S3-07 Functions: Grouping Features and Naming (Completing the Average)
A function is like a blender that produces juice when you put fruit in. It takes an input and returns a result. 'def' is for definition, and 'return' is for the result. We point out the input and output by changing just one line of the list and observing how the average changes.
S3-08 import and pip: Using tools made by others
import is like bringing in and using a verified toolbox. We calculate the average in a single line using statistics and compare it with the function we created ourselves. Tools not included by default are installed first using pip (the App Store).
S3-09 Reading Errors: Red text is actually a friendly guide
An error is not a scolding, but a "guide that tells you where the problem is." Read the error type and line number from the traceback, then copy and paste the whole thing into an AI to fix it—this is the "debugging loop." This is the most important habit to form in this course.
S3-10 Summary and Mini-Practice: Running the Average Program Once Through
Connect variables, lists, functions, loops, and error reading into a single program. By reading them as a 'flow' rather than individual syntax rules, you will be able to see the entire code written by the AI. Complete the average calculation program, commit it to Git, and link it with S2.