as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create an algorithm that returns all prime numbers up to a certain input number
user
def prime_numbers(upper_limit):
    primes = []
    for num in range(2, upper_limit+1): 
        if all(num % i != 0 for i in range(2, num)):
           primes.append(num)
    return primes
assistant