Avatar ·

The task is "minimum simple divisor"

📁 Advanced Python Topics, Error, bots

I just started to study Python on the Sirius platform. I was able to solve all other problems from the topic "While", besides one task that does not allow me to go on to the following topics. The task "the minimum simple divisor of the number".

Condition: given an integer that is no less than 2. Print its smallest simple divisor. You cannot use additional libraries (math, etc.)!

Input data: A positive integer n <= 2*10^9.

Output: print the answer to the task.

I tried to solve it by writing code with While, but my answer is not counted, due to the program running too long. It is recommended to organize a loop that iterates through