I wrote a code in C++ and would like to convert it to Python3. How to do that?
int N = 1000
for (p=2; p*p<=N; p++)
for (w=p*p; w<=N; w=w+p)
I tried to change the first for loop to:
for p in range(2,N**0.5+1):
But it doesn't work - TypeError: 'float' object cannot be interpreted as an integer
And what about the second for loop?
int(N**0.5)range(2,int(N**0.5+1)):to be accurate