Problem: Find the minimum prime number greater than or equal to X.

Submission attempts (in order):
def read_int(): return int(input())

def prime(num):
    for n in range(2,int(sqrt(num))):
        if num % n == 0:
            return False
            break
    return True
  
def solution(K):
    while not prime(K):
        K += 1
    print(K)
    
K = read_int()
print(solution(K))


import sys
import random
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from operator import add, mul, sub

inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
    
def read_int(): return int(input())
def read_int_n(): return list(map(int, input().split()))
def read_float(): return float(input())
def read_float_n(): return list(map(float, input().split()))
def read_str(): return input().strip()
def read_str_n(): return list(map(str, input().split()))
def error_print(*args): print(*args, file=sys.stderr)

#def INT_(n): return int(n)-1
#def MI(): return map(int,input().split()) # multiple int
#def MF(): return map(float, input().split()) # multiple float
def MI_(): return map(INT_,input().split()) 
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')

def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

 
def mt(f):
    import time
 
    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()
 
        error_print('## code runs for ' ,e - s, 'sec')
        return ret
 
    return wrap

def prime(num):
    for n in range(2,int(sqrt(num))):
        if num % n == 0:
            return False
            break
    return True


_DEBUG = False
#_DEBUG = True

@mt
def solution(K):
    while not prime(K):
        K += 1
    print(K)
    
def test():
    print(prime(5))
 
def main():
    if _DEBUG:
        test()
    else:
        K = read_int()
        print(solution(K))
 
 
if __name__ == '__main__':
    main()

from math import floor,ceil,sqrt,factorial,hypot,log
def read_int(): return int(input())
 
def prime(num):
    for n in range(2,int(sqrt(num))):
        if num % n == 0:
            return False
            break
    return True
  
def solution(K):
    while not prime(K):
        K += 1
    return K
    
K = read_int()
print(solution(K))

Verdicts: Runtime Error

Wrong Answer

Accepted