First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.

click to hide/show revision 2
No.2 Revision

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.