| 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.
| 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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.