Print series of prime numbers in python

You need to check all numbers from 2 to n-1 (to sqrt(n) actually, but ok, let it be n). If n is divisible by any of the numbers, it is not prime. If a number is prime, print it. You can write the same much shorter and more pythonic: As I’ve said already, it would … Read more

How to print spaces in Python?

In C++, \n is used, but what do I use in Python? I don’t want to have to use: print (” “). This doesn’t seem very elegant. Any help will be greatly appreciated!