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 iscapital 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.
tableStateCapital cityNew South Wales,SydneyQueenslandBrisbaneSouth Australia,AdelaideTasmaniaHobartVictoriaMelbourneWestern 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:
iscapitalVictoria 'Melbourne'
True
iscapitalQueensland 'Adelaide'
False
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
