開発環境
- 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 10.(Introducing Python Statements)、Test Your Knowledge: Quiz 4.を解いてみる。
その他参考書籍
- Pythonチュートリアル 第2版
- Python クックブック 第2版 (原書(最新版))
- Programming Python
- Python Pocket Reference (Pocket Reference (O'Reilly))
Test Your Knowledge: Quiz 4.
コード(BBEdit)
sample4.py
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
# using parentheses, brackets, braces.
a = (1 + 2 +
3 + 4 + 5)
print(a)
b = [1, 2,
3, 4, 5]
print(b)
c = {'a':1, 'b':2,
'c':3, 'd':4, 'e':5}
print(c)
入出力結果(Terminal, IPython)
$ ./sample4.py
15
[1, 2, 3, 4, 5]
{'a': 1, 'c': 3, 'b': 2, 'd': 4, 'e': 5}
$
0 コメント:
コメントを投稿