easierbycode
1/8/2016 - 11:08 PM

https://www.thinkful.com/learn/intro-to-python-tutorial

# -*- coding: utf-8 -*-

cat    = {
  'name'    : 'Tom',
  'weight'  : 9.5,
  'hungry'  : True,
  'photo'   : '▓▒░({ =^⦿◬⦿^= })░▒▓',
  'emoji'   : ''
}

mouse  = {
  'name'    : 'Jerry',
  'weight'  : 1.5,
  'hungry'  : False,
  'photo'   : '⁌:3 )~~~~'
}

pets  = [cat, mouse]


def feed( pet ):
  if pet['hungry'] == True:
    pet['hungry'] = False
    pet['weight'] = pet['weight'] + 1
    print pet['name'] + ' now weighs ', pet['weight']
  else:
    print pet['name'] + " isn't hungry"


for pet in pets:
  if 'emoji' in pet:
    print pet['emoji']
  else:
    print pet['photo']
  feed( pet )