To create your Hello World! program, follow these steps:
-
Open your Start menu and choose Python (command line).
You should get a prompt that looks like >>>.
At the moment, you're doing everything in interactive mode in the Python interpreter. That's where the >>> comes in. Python shows you >>> when you're supposed to type something.
-
At the prompt, type the following. Use a single quote at the start and the end — it's beside the Enter key:
print('Hello World!')
-
Press the Enter key.
Python runs the code you typed.
-
Check that the parentheses and single quotes are in the right places.
-
Check that for each opening parenthesis there is a closing parenthesis. (Otherwise, you're left hanging.
-
Check that for each opening quote there's a closing quote.
Programming languages have their own grammar and punctuation rules. These rules are the language's syntax. Humans, can work most stuff out even if perfect not you're is grammar (See? You figured out what that sentence was trying to say), but Python pretty much freaks out if you get the syntax wrong.