Complete the method that takes a sequence of objects with two keys each: country or state, and capital. Keys may be symbols or strings.

The method should return an array of sentences declaring the state or country and its capital.

## Examples

```python
[{'state': 'Maine', 'capital': 'Augusta'}] --> ["The capital of Maine is Augusta"]
[{'country' : 'Spain', 'capital' : 'Madrid'}] --> ["The capital of Spain is Madrid"]
[{"state" : 'Maine', 'capital': 'Augusta'}, {'country': 'Spain', "capital" : "Madrid"}] --> ["The capital of Maine is Augusta", "The capital of Spain is Madrid"]
```

Difficulty: introductory

Starter code:

def capital(capitals):
	

Solutions:
def capital(capitals):
    return [f"The capital of {c.get('state') or c['country']} is {c['capital']}" for c in capitals]

def capital(capitals): 
    ans = []
    for each in capitals:
        a = each.get('state', '')
        b = each.get('country', '')
        c = each.get('capital')
        ans.append('The capital of {}{} is {}'.format(a,b,c))
    return ans

def capital(capitals):
    return ["The capital of {} is {}".format(*x.values()) for x in capitals]

def capital(capitals): 
    return [f"The capital of {d['state'] if 'state' in d else d['country'] } is {d['capital']}" for d in capitals]

def capital(capitals): 
    list1 = []
    for i in capitals:
        a = list(i.values())
        print(a)
        list1.append("The capital of " + a[0] + " is " + a[1])
    return list1


def capital(capitals):
        return list(map(lambda val: 'The capital of ' + (val.get('state') or val.get('country')) + ' is ' + val["capital"],
                    capitals))

def capital(capitals): 
    # your code here
    q = []
    lst = []
    p = len(capitals)
    for i in capitals:
          for key,value in i.items():
              var1 = value
              q.append(var1)
    lst2 = []
    for x,y in enumerate(q,1):
        lst.append(y)
        if x % 2 == 0:
            lst2.append("The capital of {} is {}".format(lst[0],lst[1]))
            lst.clear()
    return lst2    

def capital(capitals): 
    return [f"The capital of {s.get('state') or s.get('country')} is {s.get('capital')}" for s in capitals]

def capital(capitals): 
    result= []
    
    for i in capitals:
        if "country" in list(i.keys()):
            country_State = "country"
        else: 
            country_State = "state"
        result.append("The capital of " + i[country_State] + " is " + i["capital"])
    return result
    



def capital(capitals):
    output = []

    i = 0
    for key1, key2 in capitals:
        if key1 == "country":
            output.append(
                f"The capital of {capitals[i]['country']} is {capitals[i]['capital']}")
        if key1 == "state":
            output.append(
                f"The capital of {capitals[i]['state']} is {capitals[i]['capital']}")
        i += 1
    return output