開発環境
- OS X Mavericks - Apple(OS)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- Python 3.4 (プログラミング言語)
Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPART Ⅲ.(Statements and Syntax)、Chapter 12.(if Tests and Syntax Rules)、Test Your Knowledge: Quiz 3.を解いてみる。
その他参考書籍
- Pythonチュートリアル 第2版
- Python クックブック 第2版 (原書(最新版))
- Programming Python
- Python Pocket Reference (Pocket Reference (O'Reilly))
Test Your Knowledge: Quiz 3.
コード(BBEdit)
sample3.py
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
a = (1 + 2 +
3 + 4 + 5)
b = (1 + 2
+ 3 + 4 + 5)
c = [1, 2,
3, 4, 5]
d = [1, 2
, 3, 4, 5]
e = {'a':1, 'b':2,
'c':3, 'd':4, 'e':5}
f = {'a':1, 'b':2
, 'c':3, 'd':4, 'e':5}
g = {'a':1, 'b':
2, 'c':3, 'd':4, 'e':5}
print(a, b, c, d, e, f, g, sep='\n')
入出力結果(Terminal, IPython)
$ ./sample3.py
15
15
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
{'e': 5, 'a': 1, 'b': 2, 'd': 4, 'c': 3}
{'e': 5, 'a': 1, 'b': 2, 'd': 4, 'c': 3}
{'e': 5, 'a': 1, 'b': 2, 'd': 4, 'c': 3}
$
0 コメント:
コメントを投稿