2014年2月11日火曜日

開発環境

Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPART II.(Types and Operations)、CHAPTER 6(The Dynamic Typing Interlude)、Test Your Knowledge: Quiz 1, 2, 3.を解いてみる。

その他参考書籍

Test Your Knowledge: Quiz 1, 2, 3.

入出力結果(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.
>>> a='spam'
>>> b=a
>>> b='shurbbery'
>>> a # spam
'spam'
>>> a=['spam']
>>> b = a
>>> b[0] = 'shrubbery'
>>> a # ['shrubbery']
['shrubbery']
>>> a=['spam']
>>> b=a[:]
>>> b[0]='shrubbery'
>>> a # ['spam']
['spam']
>>> quit()
$

0 コメント:

コメントを投稿