why the different output in Eclipse and Python Shell?

Terry Reedy tjreedy at udel.edu
Wed Aug 1 02:39:07 EDT 2012


On 8/1/2012 12:45 AM, levi nie wrote:
> my code in Eclipse:
>
> dict.fromkeys(['China','America'])

In Eclipse, I presume this prints nothing, as is normal for an editor.

> print "dict is",dict
>
> output: dict is <type 'dict'>

This is red herring. The shell does the same with that line. It is not 
relevant to your question.

> dict.fromkeys(['China','America'])
>
> output:{'America': None, 'China': None}

The interactive interpreter echoes the result of evaluating expressions.

-- 
Terry Jan Reedy






More information about the Python-list mailing list