So far, everything has run in a straight line, top to bottom, once. Real programs need to make decisions and repeat work, and those two abilities — branching and repeating — are what conditionals and loops give you. Almost every program you'll ever use is built out of some combination of these two ideas, stacked on top of each other.
An if statement runs a block of code only when a condition is true, and skips it otherwise. You can chain more checks with elif ("else if"), and catch everything else with else.
The computer checks each condition in order and runs the first block whose condition is true, then skips the rest entirely — it doesn't check every single one no matter what. With age set to 15 here, it prints "Not yet." because 15 isn't 18 or older, and it isn't 16 or older either, so it falls through to else.
A for loop repeats a block of code once for every item in a sequence, like a list of names or a range of numbers.
This runs the print line three times, once per name in the list, automatically substituting the next name in each time. Without a loop, you'd have to write a separate print line for every single name, and the code would break the moment the list changed size. The loop handles any length of list without you touching the logic at all.
A while loop keeps running as long as a condition stays true, rather than running once per item in a list. This is useful when you don't know ahead of time how many times you'll need to repeat something.
This prints 0, 1, then 2. Each pass through the loop, it checks whether count is still less than 3; if so, it runs the block, which prints the current value and then increases count by one. Once count reaches 3, the condition becomes false and the loop stops. That last line, count = count + 1, is doing real work — leave it out and the condition never changes, count stays 0 forever, and the loop runs forever too. That's called an infinite loop, and it's one of the most common beginner bugs.
Loops and conditionals are almost always used together. You loop over a collection of things, and inside the loop, you use an if statement to decide what to do with each one.
This walks through each number one at a time, and for each one, decides which message to print based on its value. That combination — repeat, and decide what to do each time — is the backbone of an enormous amount of real code, from filtering search results to processing a list of orders.