Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I tried:

sage: a=range(7000,8000)
sage: print[a if a%7==0]
  File "<ipython-input-30-590163f2a51e>", line 1
print[a if a%Integer(7)==Integer(0)]
                                   ^
 SyntaxError: invalid syntax

I tried:

sage: a=range(7000,8000)
sage: print[a if a%7==0]
  File "<ipython-input-30-590163f2a51e>", line 1
print[a if a%Integer(7)==Integer(0)]
                                   ^
 SyntaxError: invalid syntax

I find a solution:

print [a for a in [7000..7999] if a%7==0]

Thank you for suport.

I tried:

sage: a=range(7000,8000)
sage: print[a if a%7==0]
  File "<ipython-input-30-590163f2a51e>", line 1
print[a if a%Integer(7)==Integer(0)]
                                   ^
 SyntaxError: invalid syntax

I find a solution:

print [a for a in [7000..7999] if a%7==0]

Thank you for suport.support.