Question: Write a function is _ capital ( state , city ) that returns True if the named city is the capital of the named state

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.
\table[[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
 Write a function is_capital (state, city) that returns True if the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!