Ad

It should accept only positive whole numbers.So you create a function like done in examples:

Number_of_Primes(12)=>[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]

Number_of_Primes(1)=>[2]

Number_of_Primes(0)=>[]

Number_of_Primes(-12)=>"Invalid Input"

def Number_of_Primes(n):
    primes=[]
    x=2
    if n<0 or type(n)!=int:
        return "Invalid Input"
    else:
        while len(primes)<n:
            if x==2 or x==3 or x==5 or x==7 or x%2!=0 and x%3!=0 and x%5!=0 and x%7!=0:
                primes.append(x)
            x+=1
        return primes