2014年2月5日水曜日

開発環境

Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPART II.(Types and Operations)、CHAPTER 4(Introducing Python Object Types)、Test Your Knowledge: Quiz 2を解いてみる。

その他参考書籍

Test Your Knowledge: Quiz 2

最初から使える(モジュールをインポートする必要なく使える)型だから。(ビルトインオブジェクト)。

入出力結果(Terminal)

$ python3
Python 3.3.3 (default, Dec  2 2013, 01:40:21) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> math # mathはcore typeじゃないからインポートする必要がある
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'math' is not defined
>>> import math
>>> math
<module 'math' from '/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/lib-dynload/math.so'>
>>> type(math)
<class 'module'>
>>> quit()
$

0 コメント:

コメントを投稿