| 1 | initial version |
using list comprehension:
sage: [i for i in [1..10] if i%2==0]
[2, 4, 6, 8, 10]
see more alternatives in the Programming in Python and Sage Thematic Tutorial.
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.