-5
\$\begingroup\$

1.Write a function that returns the first n prime numbers as a numpy.ndarray object. The only input to your function is n for example if n= 3 then the output should be [1,2,3] if n= 7 output [1,2,3,5,7,11,13]

def get_primes(n):
    numbers = set(range(n, 1, -1))
    primes = []
  1. A farmer has f meters of fence and wants to fence off a rectangular field that borders a straight river. The trick is he needs no fence around the river. Write a function that for any fence length f returns the dimensions of the field (xandy with x≤y) with the largest area
\$\endgroup\$

Browse other questions tagged or ask your own question.