Ask Your Question

Revision history [back]

Yes, definitely use Integer to get access to exact arithmetic. Python isn't built for this, and int is a Python class. Sage and its Integer class are built for this. You could do L = random.sample([Integer(n) for n ...]) or use srange instead of range to iterate using the Integer class.

Yes, definitely use Integer to get access to exact arithmetic. Python isn't built for this, and int is a Python class. Sage and its Integer class are built for this. You could do L = random.sample([Integer(n) for n ...]) , or use srange instead of range to iterate using the Integer class.