3

次のコードは、私のインタープリターで完全に正常に動作します

a = [5, 1, 4, 3]
b = sorted(a)

Jupiter から実行すると、このエラーが表示されるのはなぜですか。

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-71-4a5766271a85> in <module>()
----> 1 b = sorted(a)

TypeError: 'list' object is not callable

バージョン:

Server Information:
You are using IPython notebook.

The version of the notebook server is 3.2.0-8b0eef4 and is running on:
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.1500 64 bit (AMD64)]

Current Kernel Information:
Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 3.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
%guiref   -> A brief reference about the graphical user interface.
4

1 に答える 1