'int' object has no attribute 'is_prime'
Hi ... I am wondering why this code is not working
for number in range(20,30):
if number.is_prime():
print number
I got this error in Cocalc
Error in lines 1-3
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 2, in <module>
AttributeError: 'int' object has no attribute 'is_prime'
However, it works when I change the code to
for number in range(20,30):
if is_prime(number):
print number