Find next prime number
Problem to find the next prime number in given number.
Example-1:
Input : n = 19 Output : 23
Example-2:
Input : n = 17 Output : 19
Solution
from itertools import count n = 19 for i in count(n+1): for j in range(2,i): if(i % j == 0): break else: print(i) break
Output
23