Avatar ·

Task "Minimum Prime Divisor"

📁 Advanced Python Topics, Error, bots

Just started learning Python on the Sirius platform. I managed to solve all other tasks in the "while" topic, except for one task that prevents me from moving on to the next topics. The task is "Minimum prime divisor of a number".

Condition: Given an integer not less than 2. Print its smallest prime divisor. You cannot use additional libraries (math, etc.)!

Input data: A positive integer N <= 2*10^9 is entered.

Output data: Print the answer to the task.

I tried to solve it by writing code with while, but my answer is not accepted due to the program running too long. They recommend organizing a loop that iterates through divisors up to the square root of N: while i*i <=