Sample Input: 5 Sample Output: 2 3 5 Solution n=int(input()) for x in [x for x in range(2, n+1) if all(x % y != 0 for y in range(2, x))]: print(x) Related Content Python Tutorial NumPy Tutorial Pandas Tutorial Python Control Flow Interview Questions Python Interview Questions Comments Log in or register to post comments
Comments