Step 1: Run your first script
The dark panel at the bottom is a terminal: you type a command, press Enter and it runs. Python runs right here in your browser, so there's nothing to install. It reads a file of instructions and runs them from top to bottom.
hello.py is open in the editor. It has one line:
print("Hello, world!")
print shows whatever is inside its brackets. The quotes mark a string: a piece of text, kept
exactly as you write it.
- Press Run. The lab runs
python3 hello.pyfor you, and the terminal showsHello, world!. You can also typepython3 hello.pyin the terminal yourself and press Enter. - Sam wants the till to greet customers. Change the words between the quotes to
Good morning from Bean There!and press Run again. - Press Check.
Break it on purpose. Delete the closing quote and press Run. Python stops and prints a
SyntaxError that points at the line it couldn't read. An error is Python telling you where it got
confused, and the last line of it names the problem. Put the quote back before you press Check.
hello.py, the file you edit1 lines
print("Hello, world!")