Python Introduction
Python is a language for instructions you run. A short program is a text file. The interpreter reads that file from the top and does each line. This page has one job: show text. The visible result is the word tea, and then a two-line note: lida, then tea.
A program is a list of instructions
Each line is one instruction. The interpreter starts at the first line and moves down. It does not guess what you meant. If a line is not valid Python, it stops and reports an error before the later lines run.
This course is not a page in the browser
print writes text for a person to read. It does not select an element, and it does not change a document. HTML, CSS, and JavaScript were about pages. Here the program runs on its own. Nothing on this page is a heading, a style, or a click.
Show one word
print is a function. The parentheses hold what should be shown. Quotes mark text. print("tea") shows tea. The quotes stay in the program so Python knows tea is text, not a name you created.
print("tea")
The output is tea. The quotes are not part of that output. Take them away and Python treats tea as a name. This page never created that name, so the program stops.
Two lines, from the top
A second print runs only after the first one finishes. The first output line is lida. The second output line is tea. Nothing joins them with a slash. Each print starts its own line.
print("lida")
print("tea")
Read the output as two lines. First lida. Then tea. If you swap the two calls, the lines swap too. The order on the page is the order in the file.
Quotes, parentheses, and lowercase
print "tea" without parentheses is not valid in today's Python. The opening quote needs a closing quote on the same text. print must be lowercase. Print is a different spelling, and it is not the function that shows text.
A counter note
The two lines are a short note at a counter. The first line names the guest, lida. The second line names the drink, tea. Later pages will store those as values. This page only prints them, in that order.
What this page leaves alone
This page does not create a name, does not read what you type, and does not open a file. Those come later. The only result here is text: one word, or two lines.
The next page
You do not install anything here. The next page is how to install Python and run a file like this one. After that the course moves through values, decisions, lists, files, and a small command-line program. No web framework.
At the counter
- Read print("tea"). The shown word is tea, without quotes.
- Read print("lida") and then print("tea"). First line lida, second line tea.
- Keep the quotes. Without them, tea is a name this page did not create.
- Write print in lowercase, and keep the parentheses.
- Read the page output again: lida, then tea.
Misses
print shows text. It does not build a web page, and the quotes are not printed.
- Expecting print to change a document in the browser
- Dropping the quotes or the parentheses
- Writing Print with a capital P
- Thinking the two calls share one line
- Reading the output as lida / tea
Keep this
- A Python program is text. The interpreter runs it from the first line downward.
- print("tea") shows tea. The quotes are not shown.
- print is lowercase, and the parentheses hold the text.
- Two prints make two lines. This page prints lida, then tea.
- Install and running a file are the next page, not this one.
🧠 Test Your Knowledge
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top