Chapter 10:00โ5:49
Python tutorial for beginners ๐
Getting set up: installing Python, choosing an editor, and running a first program.
Before writing any code you need two things: the Python interpreter, which actually runs your programs, and an editor to write them in. The interpreter is a free download from python.org; the editor can be anything from a full IDE to a plain text editor.
Your first program
Tradition says your first program should greet the world. In Python that is a single line:
python
print("Hello, world!")print is a built-in function: you call it by writing its name followed by parentheses, and whatever you put inside the parentheses is printed to the console. The text in quotes is a string.
โถ Video clip 2:30โ3:55 โ https://youtu.be/ix9cRaBkVe0?t=150
Key takeaways
- Install the interpreter first, then an editor.
- print() writes text to the console.
- Comments start with #.
- Interpreter
- The program that reads and runs your Python code.
- String
- A sequence of characters written between quotes.
Check your understanding
1. What does the interpreter do?