Now that I know how to sum all the primes under 2 million quickly. What job should I apply for?
Please help me.
>using Windows 7
Mohammad, the world is already on Windows 10.
>>60222350
maybe the US military is but not me.
>>60222310
>What job should I apply for?
interviewer
>>60222377
surely that's not an actual job. they pull full time programmers to do interviews whenever they need more people
try caching so you don't do the same calculations over and over again
>>60222310
>importing math module to take the sqrt instead of just using x**0.5
>windows
>VS
>VSC + Python
Is this more disgusting than Atom?
>>60222450
or just calculate by hand since it's only calculated once
>>60222482
its the new, better Atom and I find it quite pleasant
I think you are ready to apply here
https://careers.google.com/
>>60222450
Also, forgot to add:
>using lists for truth testing instead of unsigned char array
You can't even sieve a couple billion without using multiple GiB of memory. Utter trash, I'm appalled that something so trivial can be fucked up so hard.
https://docs.python.org/3/library/array.html
>>60222583
>>60222516
your feedback is absolutely appreciated.
Use xrange instead of range. range allocates an array in memory, xrange is a generator with O(1) memory usage.
>>60222387
Then... how about a "technical recruiter"? They always contact me on linkedin and they never seem to have any idea what the fuck they're talking about.
>>60222727
>NameError: name 'xrange' is not defined
>python 2
>>60222727
python 3 took xrange from python2 and named it range. So i'm already using xrange
>>60222727
Not in Python 3 – they deprecated the old `range` and xrange became range.
OP, the algorithm looks fine but look into more performant Python. NumPy is a low-hanging fruit there. You can also try Cython and Numba.
>>60222350
Still using win7 too... Hate Win10 interface. I might be wrong but I'll stick to my 7 a bit more until I need to play some DX12 games
>>60222834
>checking even numbers
>algorithm looks fine
If you fail to spot instances of unimplemented trivial optimization, you have no place commenting on whether or not an algorithm is "fine".
dont forget about me
>>60222482
>>60222489
your text editor is running in a fucking web browser. stop it.
>>60223657
what what's wrong with that?
it's supposed to run in a commandline and take me 40 hours to learn?? is that what u think?
>>60222310
>iterating from 2 to sqrt
>log
>>60222350
eat shit and die, pajeet