Output and input
Output is text a program shows you; print() writes it to the terminal. Input is text you type back; input() reads it. Run python age.py and Python works through the file from top to bottom.
Reading input
Line 1 calls input("Name? "). It writes the prompt exactly as given, with no newline after it, then waits. Nothing else runs until you type an answer and press Enter.
You type Sam and press Enter. input() drops the Enter, gives back the rest as a string, 'Sam', and = stores it in the variable name.
Line 2 asks Age? the same way. Notice the space inside the quotes: input() adds nothing of its own, so without that space your answer would touch the question mark.
You type 15. input() always returns a string, so text holds '15' in quotes: the characters 1 and 5, not the number fifteen. Python cannot do sums with it yet.
Using the answers
Line 3, int(text), reads the string '15' and gives back the whole number 15, with no quotes. Now age holds a real number. For decimals such as '1.5', use float() instead.
Line 4 prints two items: the string "Hi," and the value of name. print() puts one space between items and a newline after the last: Hi, Sam. It never shows the quotes.
Line 5 uses an f-string: an f before the quotes lets you put code inside braces. Python works out age + 1, which is 16, and writes it into the text: Next year: 16.
A common mistake
Write age = text + 1 instead and the program stops at line 3 with a TypeError: Python will not add the number 1 to the string '15'. Convert what input() gives you first, then do sums.
Try it yourself
;; step 1/9
print("Hello") # output: program -> you
reply = input("? ") # input: you -> program
$ python age.py # run the whole file
On macOS and Linux the command is often python3 rather than python; on Windows the py launcher also works. The $ is the terminal's own prompt: you do not type it. The figure shortens the error: the real traceback also names the file, the line and the code, and the terminal wraps the long last line.