1 | initial version |
You first need to import sage.all
.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec 9 2017, 17:25:34)
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
2 | No.2 Revision |
You first need to import sage.all
.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec 9 2017, 17:25:34)
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
Edit: you could even directly import ZZ
form sage.all
:
$ sage -python
Python 2.7.14 (default, Dec 9 2017, 17:25:34)
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sage.all import ZZ
>>>
3 | No.3 Revision |
You first need to import sage.all
.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec 9 2017, 17:25:34)
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
Edit: you could even directly import ZZ
form sage.all
:
$ sage -python
Python 2.7.14 (default, Dec 9 2017, 17:25:34)
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sage.all import ZZ
>>>
References: