Activity1.3.1Basic Sage commands
  1. Sage uses the standard operators +, -, *, /, and ^ for the usual arithmetic operations. By entering text in the cell below, ask Sage to evaluate

    \begin{equation*} 3 + 4(2^4 - 1) \end{equation*}

  2. Notice that we can create new lines by pressing Enter and enter additional commands on them. What happens when you evaluate this Sage cell?

    Notice that we only see the result from the last command. With the print command, we may see earlier results, if we wish.

  3. We may give a name to the result of one command and refer to it in a later command.

    Suppose you have three tests in your linear algebra class and your scores are 90, 100, and 98. In the Sage cell below, add your scores together and call the result total. On the next line, find the average of your test scores and print it.

  4. If you are evaluating Sage cells inside an online version of this book, please be aware that your work will be lost if you reload the page. If you are working online at, however, your results will be saved.

  5. If you are not a programmer, please ignore this part. If you are an experienced programmer, however, you should know that Sage is written in the Python programming language and that you may enter Python code into a Sage cell.