the python shell

Try typing python without anything else after it. You should see something like this:

$ python
Python 3.5.2 (default, Jun 28 2016, 08:46:01) 
[GCC 6.1.1 20160602] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

You’re now in a new kind of command line interface, the Python command line interface. We call it the Python shell. Why do we call it a shell? It would take me more than ten words to explain, so don’t worry about it. In general, it may help you be less confused if whenever you see a word that seems out of place, assume it’s like that because of historical reasons and don’t worry about why they called it that (they had to call it something). That’s what I do a lot.

Remember the “prompt” from the command line? See that >>> up there? That’s your new prompt! As long as it’s there, the terminal/Command Prompt is expecting Python commands, not regular ones. So try typing this command and see what happens ;)

>>> print('I like cheese')

The Python shell will be a valuable tool for you. You can use it to try out new Python commands as you learn them. Later you will learn how to save these commands in a file and run them like a normal program.

When you’re done, type quit() to exit the Python shell and go back to the normal command line:

>>> quit()
$

You’ve finished the introduction! Tune in next time to learn a bit more about print.


previous: installing python next: print