#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

def main():
    states = {
        'Oregon': 'OR',
        'Florida': 'FL',
        'California': 'CA',
        'New York': 'NY',
        'Michigan': 'MI'
    }

    cities = {
        'CA': 'Miami',
        'MI': 'Detroit',
        'FL': 'Jacksonville'
    }

    cities['NY'] = 'New York'
    cities['OR'] = 'Portland'

    print '-' * 10
    print "NY state has:" , cities['NY']
    print "OR state has:" , cities['OR']
    
    print '-' * 10
    print "Michigan abbr is", states['Michigan']
    print "Florida abbr is", states['Florida']

    print '-' * 10
    print "Michigan has: ", cities[states['Michigan']]
    print "Florida has: ", cities[states['Florida']]
    
    print '-' * 10
    for state, abbr in states.items():
        print "%s is abbreviated as %s" % (state, abbr)
    
    print '-' * 10
    for abbrev, city in cities.items():
        print "%s has the city %s" % (abbrev, city)

    print '-' * 10
    for state, abbrev in states.items():
        print "%s is %s and has city %s" % (state, abbrev, cities[abbrev])

    print '-' * 10
    state = states.get('Texas', None)
    if not state:
        print 'Sorry, no Texas.'

    print '-' * 10
    state = states.get('Texas', 'Does not exist')
    print "The city for the state 'TX' is %s" % state

    sys.exit(0)


if __name__ == '__main__':
    main() 