Python Version

Checking the Python Version

In the terminal (the bottom section) check the version of python.

  • At the command prompt type python
  • The following information should be displayed
Python 3.6.10 (default, Feb 10 2020, 19:55:14) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

The version may change to later versions of python for example 3.7 or 3.8.

Interactive Mode

This is the interactive python environment. You can enter python commands directly into this and they will run as python. This is a great tool for quickly testing python commands.

Try that now using an example. Type or copy the following into the python interactive environment after the >>>

some_string = "Hello Python"
print(some_string)

This should return the following:

>>> some_string = "Hello Python"
>>> print(some_string)
Hello Python

Congratulations!

You have just created your first python variable called some_string and given it a value "Hello Python".

You then printed the value of the variable using the built in print function.

Exit Interactive Mode

To exit the python environment use crtl + d or by typing exit().