開発環境
- OS X Mavericks - Apple(OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python (プログラミング言語)
Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPART II.(Types and Operations)、CHAPTER 4(Introducing Python Object Types)、Test Your Knowledge: Quiz 1を解いてみる。
その他参考書籍
Test Your Knowledge: Quiz 1
- Numbers
- Strings
- Lists
- Dictionaries
- Others…
入出力結果(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.
>>> 10
10
>>> 1.2
1.2
>>> "python"
'python'
>>> ""
''
>>> [1,2,"python",[3,4]]
[1, 2, 'python', [3, 4]]
>>> {'a':1,'b':2,'c':[1,2],'d':{'e':'E'}}
{'a': 1, 'c': [1, 2], 'b': 2, 'd': {'e': 'E'}}
>>> (1,2)
(1, 2)
>>> {1,2}
{1, 2}
>>> (x for x in range(10))
<generator object <genexpr> at 0x107bd1a00>
>>> f=open('temp.txt', 'a')
>>> quit()
$
0 コメント:
コメントを投稿