Lesson 2
The Basic Elements
Chapter 3: Running Python
Running Python interactively
Python is (sort of) an interpreted language.
As a result, you can also run Python interactively.
Type python
(or python3
or python3.8
depending on your setup) into the command line.
$ python3
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
You should get an interactive prompt, which you can now use to type Python code interactively. Make sure you are using the correct version!
Now, type these into the Python prompt:
>>> 1+1
2
>>> "I am a genius"
'I am a genius'
Yes, you are indeed a genius! 😃
Finally, type exit()
or quit()
or Ctrl+D to exit the prompt.