Python and Sage

Program examples in this class will be in Python or Sage. Assignments can be done in any language, but I would prefer Python3 or Sage.
Python is a common programming language, used everywhere, and useful to learn.
Sage is built in python, but includes many functions for pure and applied math, so is often easier to get started for math applications.
Either of them you can use by installing on your computer, or use online.

Using Python or Sage on your computer

Python is a language. You can put your program in a file, and then run the program in an interpretor, from a command prompt or terminal:

Commandline Python


You can also use Python interactively in your terminal.

Interactive Python


If this is scary, you can also find many 'graphical environments' that combine the bits for you. VSCode is a common one.

Another nice one for interative use is the Jupyter Notebook.

Python Jupiter Notebook


You can install this on your computer. If you have Python installed, you can install it easily with pip. Here is a nice tutorial. It will help you install the notebook and introduce you to using it. Several students in the department should know how to install python. If you don't hopefully they can help you.

Sage is the same. You can use it all the same ways. You can download and install it on your computer. (Be warned that it is big. Over 1Gb download and uses over 4Gb on your harddrive.):

Windows: Sagemath on Github
Linux or Mac: Sagemath Download Page


Or, both Sage and Python can be used online, so you do not have to install it.
There are several places online that you can use Jupyter Notebooks. Some are free, and some are paid. All will allow you to use Python, but few will allow you to use sage. For sage, the main one is Cocalc.com. It is free, but the free version is slow. If you pay $3 per month it is much faster.

For this class, I will try to run a Cocalc server from my office: KNU Cocalc Server . To sign-in you will need a code that I will give you. Those who are comfortable installing Python or Sage another way though, please do. The more people that use this, the slower it will run.