Vid2Book.com

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.

2:30โ€“3:55Creating a project and running the first program

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. 1. What does the interpreter do?