In a throwback to CT days, you have to write one of the basic list functions.
Write a function named first that accepts a list L as argument. It should
return the first element if the list is non-empty, and return None otherwise.
You do not have to accept input from the user or print anything to the console. You just have to write the function definition.
Example
first([10, 20, 30]) -> 10
first([]) -> None
Implement this function:
def first(L):
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: L.
Input
[]
Output
None