Generation

generate functionWed, 18 Jan 2023

Write a function that pulls the year number from the string: Example: string = 'Pulp Fiction (1994)' result 1994

def get_year(string): return string.split()[-1].strip(')') get_year('Pulp Fiction (1994)')

Questions about programming?Chat with your personal AI assistant