Interview Query

Prime to N

Start Timer

0:00:00

Upvote
19
Downvote
Save question
Mark as completed
View comments (27)
Next question

Given an integer N, write a function that returns a list of all of the prime numbers up to N.

Note: Return an empty list there are no prime numbers less than or equal to N.

Example:

Input:

N = 3

Output:

def prime_numbers(N) -> [2,3]
.
.
.
.
.


Comments

Loading comments.