Write and run your first program in the command line

Now that you are set up, it is time to write your first line of code in Python! This line of code is almost a tradition for people who are programming for the first time, and it allows us to use one of the most basic, but most useful, functions in the Python language.

First, you need to start running a Python shell. On Mac or Linux, open your terminal and type this:

python

In the Mac or Ubuntu terminal, your resulting Python shell will look like this:

>>>

In Windows, type Python in the search bar at the bottom of the page. Then, select Python 2.7.11 from your apps. You will also have a Python shell open:

>>>

Once you see this symbol, your computer is now ready to work with the Python code. In your ...

Get Python Projects for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.