How to Start Writing Your First Python Program
A beginner-friendly guide to writing your first lines of code in Python and seeing them run on your computer. HowTo: Family Edition: family how-tos that actually help.
- Find an online editor. You don't need to install anything right away. Ask a grown-up to help you find an 'online Python compiler' in your web browser. These websites let you type code and run it instantly without needing to set up a complex environment.
- Type your first command. Look for the text box on your screen. Type exactly this: print('Hello, World!'). Make sure to include the parentheses and the single quotes exactly as shown.
- Run the code. Look for a button on the screen that says 'Run' or 'Execute.' Click it, and watch the area below your code. You should see the words 'Hello, World!' appear.
- Experiment with changes. Change the words inside the quotes to your own name, like print('Hello, Alex!'). Click 'Run' again to see your computer greet you by name.