Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Your code uses floating-point division instead of integer division (times have changed since Python 2. -> 3.)
Your code will fail for very large non-prime numbers like
2^32
because it performs a lot of unnecessary computation in prime && divisor checking. (You should read about prime divisors and find an optimal boundary to stop the iteration)issue with your code is not an issue, read this
I tried to check if n is a prime number when each time n changes. Hope this can help.