More Succint Code for Prime Numbers
It's 12:55 midnight, I was working on a problem statement of Euler Project+, and I just got an idea to make the algo for finding the prime number even more efficient than the one I made by returning the list of bools to check if the number is prime or not. This time I would not be using a separate function for checking that but instead I will use 2 list comprehensions at a time, and will print the numbers by using the first list made inside another list for every number.
Comments
Post a Comment