CoCalc Public FilesLab1.ipynbOpen with one click!
Author: Basel Magableh
Views : 65
Description: CF1 Lab1
Compute Environment: Ubuntu 18.04 (Deprecated)

Part 2. Assignment, Equality, and Arithmetic

With some minor exceptions, Sage uses the Python programming language, so most introductory books on Python will help you to learn Sage. Sage can do much that your favorite computer algebra system has to offer. Sage uses = for assignment. It uses == , <= , >= , < and > for comparison:

In [3]:
a=5
In [4]:
a
5

Logical Statments

In [5]:
2==2
True
In [6]:
a < 2
False
In [8]:
b=8
In [9]:
b > a
True
In [11]:
0 < -1
False

Sage provides all of the basic mathematical operations

In [13]:
2* 3
6
In [14]:
2**3
8
In [15]:
2^3
8
In [17]:
10 % 3
1
In [18]:
10/4
5/2
In [19]:
10 //4
2
In [20]:
4 * (10//4) + 10 % 3 == 10
False