Question: may i know what hidden input did i fail? tructions Forum Tutoring Problem Write a function is_capital(state, city) that returns True if the named city

tructions Forum Tutoring Problem Write a function is_capital(state, city) that returns True if the named city is the capital of the named state and False otherwise. Every city and state in the following table should be recognised. State Capital city New South Wales Sydney Queensland Brisbane South Australia Adelaide Tasmania Hobart Victoria Melbourne Western Australia Perth If a city or state is not in the table the function must return false. Here are some examples of how your function should work: >>> is_capital('Victoria', 'Melbourne') True >>> is_capital('Queensland', 'Adelaide') False apital City Testing > Run Terminal Reset program.py > WN 1 def is_capital(state, city): 2 dict = {'New South Wales': 'Sydney', 'Queensland': 'Brisbane', 3 'South Australia': 'Adelaide', 'Tasmania': 'Hobart', 'Victoria': 'Melbourne', 'Western Autralia': 'Perth'} 5 for key, value in dict.items(): 6 if (key==state and value == city): return True 4 5 5 000 return false Submissions Output #8 Not yet! Failed a test (4 tests passed). 25 minutes ago Checking your submission against PEP8. Testing the first example from the problem. Testing the second example from the problem. Testing a territory that is not in the table of capitals. X Testing a hidden input. Autosaved 25 minutes ago 3 days ago > #7 Not yet! Failed a test (4 tests passed)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
