There are different ways to program in Python.
The most basic one is the shell/Terminal. Type:
And something like this should appear:
Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
The problem with Python in the shell is that you have to type and retype a lot. That is why you better use and editor, like Atom, Visual Editor, Sublime text….
The shell is useful to quickly test functions or small snippets of code, especially handy when you’re working on larger scripts.
The Python editor allows you to write scripts.
Ideally you create a folder for your project on your Desktop. You create a new file in the editor (like Atom). You save it in the new folder, specifying the extension .py. Make sure your script has a significant name. With something like ‘print.py’ you might run into trouble.
Once you have your script saved, you open a terminal and move to your folder:
$ cd Desktop/yourfolder
Once you’re in the folder, you can check whether your script is there:
$ ls (Note: for Windows this is: dir)
Once you’re in the folder, you can execute your script:
$ python name_of_script.py (Note: in Windows there is no need to mention python)
Some operating systems still have Python 2.7 as a default. It then helps to run your script as follows:
$ python3 name_of_script.py
You now will see your script act in the terminal. You can easily adapt the code in the file and run it again!