ó
žØ_Zc           @   sÛ   d  Z  d d l Z d „  Z e d k r× d d g Z i d	 d 6d d 6Z e j d
 e ƒ Z i d d 6d d 6Z e j d e ƒ Z	 e e	 g Z
 d Ge Gd Ge e e
 ƒ j ƒ  GHd g Z d Ge Gd Ge e e
 ƒ j ƒ  GHn  d S(   sð   
Here's the intended output of this script, once you fill it in:

Welcome to shop1 fruit shop
Welcome to shop2 fruit shop
For orders:  [('apples', 1.0), ('oranges', 3.0)] best shop is shop1
For orders:  [('apples', 3.0)] best shop is shop2
iÿÿÿÿNc         C   sv   t  d ƒ } d } x] | D]U } d } x+ |  D]# \ } } | | j | ƒ | 7} q, W| | k  r | } | } q q W| S(   s`   
        orderList: List of (fruit, numPound) tuples
        fruitShops: List of FruitShops
    t   infg        N(   t   floatt   Nonet   getCostPerPound(   t	   orderListt
   fruitShopst   minCostt   minShopt   shopt   costForShopt   fruitt   pounds(    (    s   shopSmart.pyt	   shopSmart   s    t   __main__t   applesg      ð?t   orangesg      @g       @t   shop1g      @t   shop2s   For orders s   , the best shop iss   For orders: (   s   applesg      ð?(   s   orangesg      @(   s   applesg      @(   t   __doc__R   R   t   __name__t   orderst   dir1t	   FruitShopR   t   dir2R   t   shopst   getName(    (    (    s   shopSmart.pyt   <module>   s   	 	