This is, because in your for loop you print something every single time you check n % i.
Instead, you should quit (return) when you find that n % i == 0 and only print that the number is a prime after your for loop is finished (meaning you didn't find any divider).