What Is Python? Your First Program
Your first Python program
Python is a programming language: it gives you rules for writing instructions that a computer can carry out. A Python interpreter is the program that reads and executes those instructions. CPython is one implementation of Python, not the language itself. Start with one instruction that displays a message.
Output: Hello, learner!. print is a built-in function, a ready-to-use operation. The parentheses hold what you want to display. The quotation marks delimit text in the source; they do not appear in the output.
Source, interpreter and output
Source is the text you write, such as the line above. The interpreter processes it; output is the result displayed to the user. Saving a file does not run it. Python can be used for small automation scripts, data processing and larger applications; these all begin with readable instructions.
The interpreter executes these two statements in order. Each print displays its message followed by a line break.
Try it yourself
Change the second message to Packed. Predict the two output lines before running the program. Keep the quotes around the message and the parentheses around the argument. Next you will learn how to run a saved script or an interactive command.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Source, interpreter and output
Check your understanding of what python is.
Which part is Python source code?
What does the interpreter do?
What appears when this code runs?
print("Ready")