All Print
does is print the numbers in the output line, in this case it is not necessary at all.
There are a few ways of getting the list you are looking for. The most straightforward, and useful for learning how Mathematica does things, is
Table[Prime[i], {i, 1, 4, 1}]
(* {2, 3, 5, 7} *)
Once you figure out what that means, you can use shorthand to get it quicker
Prime@Range@4
(* {2, 3, 5, 7} *)
If you want to select only those primes less than a certain number, one direct way to do that is to get a list of primes that is certainly larger than that, and use Select
to get only the ones you want,
Select[Prime@Range@20, (# < 10 &)]
(* {2, 3, 5, 7} *)
But the better way, in that it doesn't do more work than is needed, is to follow this postthis post
Prime@Range@PrimePi@10
(* {2, 3, 5, 7} *)