1. Engineering
  2. Computer Science
  3. need help with this question write a function take first...

Question: need help with this question write a function take first...

Question details

Need help with this question.

Write a function take first n that takes a list l and an integer n as arguments. The function should return (as a new list) the first n values from the list. In the event that n is greater than the length of l , the entire list should be returned.

I know this is correct thus far

def take_first_n(l, n):
return

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution