The answer to your first problem is to use indentation. Indentation in python is usually a tab space or 4 blank spaces.
Try this:
i=2
>>> while i<12 :
... print(i)
where space is a tabspace:
i=2
>>> while i<12 :
... <tabspace>print(i)
The reason for the 2nd error is probably that Python path is not set. You have to do something like this:
$ PATH=$PATH:<path to Python folder/directory>