The program
Edit anything and press Run. The output below was produced by running this exact code.
How it works
A prime number has exactly two divisors: 1 and itself. The function rules out everything below 2 first, then tries every divisor i starting at 2.
The loop only runs while i * i <= num. If a number has a divisor bigger than its square root, it must also have one smaller than it, so checking further would be wasted work. That one condition makes the check much faster for large numbers.
As soon as a divisor is found, lautao galat exits the function. If the loop finishes without finding one, the function reaches lautao sahi.