How to check if number is prime if no divisibles
<p>I'm new to programming, I need to know if it's possible to print a string like "This is a prime number" if there were no results for i</p>

<pre><code>n = int(input("Digite um nÃºmero inteiro positivo: "))
for i in range(2,n):
    if n % i == 0:
         print(i)
</code></pre>

<p>For example if I typed 5 Nothing show up</p>

<p>If I typed 8 it would show 2 and 4</p>

<p>How can I add a print(n,"is a prime number") if NOTHING shows up in the program?
I couldn't find any command for that</p>

<pre><code>def isPrime(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

def getFactors(n):
    myList = []
    for i in range(2, n):
        if n % i == 0:
            myList.append(i)
    return myList

num = 17
num2 = 20
if isPrime(num):
    print("prime")
else:
    print(getFactors(17))
if isPrime(num2):
    print("prime")
else:
    print(getFactors(num2))
</code></pre>

python python-3.x