Ask Your Question

Revision history [back]

The difference is that in the for loop you use range so you get Python int objects, and when you type 10 you get a SageMath Integer (thanks to the preparser). For int objects in Python 2, / is floor division, so you get 10/4 == 2. Use srange if you want a range of SageMath Integers.