[EMAIL PROTECTED] wrote:

> What is the difference between
> 
>  " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "
> 
> and
> 
> " d1 = dict(A = 1, B = 2, C = 3) "  ?
> 
> All of the dictionary examples I saw (python.org, aspn.activestate.com,
> Learning Python by Lutz, among others) use d={'x' : 'y'}.

In the latter case the values are ints, whereas in the former they are 
strings.  But you probably didn't mean that; indeed it is the case that

        d1 = {'A': 1, 'B': 2, 'C': 3}

and

        d2 = dict(A=1, B=2, C=3)

are equivalent.

-- 
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   I do not promise to consider race or religion in my appointments. I
   promise only that I will not consider them. -- John F. Kennedy
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to