Write a function that prints out prime numbers.
Implement print_primes(n), where n is a non-negative integer. The function should identify every prime number from 2 through n, inclusive. For testability, return the primes as a list in ascending order rather than relying only on console output.
n[2, n]A prime number is an integer greater than 1 with exactly two positive divisors.
def print_primes(n):