class Address: def __init__(self, country): self.country = country def get_capital(self): if self.country == 'canada': return "ottawa" if self.country == 'nigeria': return "Abuja" if self.country == 'america': return "Washington D.C" if self.country == 'united Kingdom': return "London" address = Address('canada') print(address.get_capital())
ottawa