Ask Your Question

Revision history [back]

Your Python syntax is indeed wrong. It should be

sage:  A=[n^2+n+m^2 for n in [1..100] for m in [0..41]]

The "and" keyword is reserved for the binary operation.