1#add this code to your code and call "nextprime(number)"
2def nextprime(n):
3 prime=0
4 n+=1
5 for i in range(2,int(n**0.5)+2):
6 if n%i==0:
7 prime=0
8 break
9 else:
10 prime=1
11 if prime==1:
12 print(n)
13 return
14 else:
15 nextprime(n)
16 return