Python 3 — Welcome & Your First Hello World
Welcome to Python! If you are learning your very first programming language, you chose the best one. Python is famous for its clean, English-like syntax, allowing you to write powerful programs in fewer lines of code compared to Java or C++. Let's kick off this boot camp by running your first Python program.
Python is a high-level, general-purpose, interpreted programming language created by Guido van Rossum in 1991. The name "Python" wasn't inspired by the snake; instead, Guido named it after his favorite comedy show, Monty Python's Flying Circus!
Unlike languages that require compilation (converting code to machine language before running), Python runs line-by-line using an interpreter. This makes writing and testing code extremely fast and beginner-friendly.
In most programming languages, print programs require class wrappers, public voids, or imports. In Python, writing a message to the screen requires only a single line. Let's see the print command:
print("Hello, World!")
print("Welcome to Our Compiler!")
The print() function is a built-in command that tells the computer to output whatever is placed inside the parentheses. The text must be surrounded by quotation marks (either single quotes ' or double quotes ") to show Python that it is text (a string).
When you click ▶ Run Code, the compiler takes your code and runs it sequentially:
| Step | What Happens | Result |
|---|---|---|
| 1. Read | Interpreter reads the first line: print("Hello, World!") | Validates syntax |
| 2. Execute | Translates it to byte code and executes the instruction | Displays "Hello, World!" in output |
| 3. Advance | Moves to the next line: print("Welcome...") | Displays second line and finishes |
- Capitalization: Python is case-sensitive! Typing
Print("Hello")with a capital "P" will result in aNameErrorbecause Python only recognizes the lowercaseprint. - Missing Quotes: Leaving out quotes, like
print(Hello World), causes aSyntaxErrorbecause Python thinks "Hello" and "World" are variable names.
Let's write a simple program. Open the compiler, clean out the editor, and write a program that displays your name, a fun fact about you, and what programming language you want to learn next. Execute it to see the output.