Create a function called BestYears that will accept City and State…

Question Answered step-by-step Create a function called BestYears that will accept City and State… Create a function called BestYears that will accept City and State as arguments.If the City does not appear in the dataframe, then the function should display the error message City does not exist.If the City appears but not with that State in the combo, then the function should display the error message Invalid Input.If the City and State combo appears in the dataframe, then the function should display the City, State, Year, ImportTons, ExportTons and Difference sorted by Year with the oldest year showing first.Use different cells to test your function with each of the following:Norfolk and VA – this should show output dataNorfolk and CA – this one should show the error message Invalid Input.Python and MA – this one should show the error message City does not exist.  Computer Science Engineering & Technology Python Programming PYTHON 700 Share QuestionEmailCopy link Comments (0)