開発環境
- 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 11.(Assignments, Expressions, and Prints)、Test Your Knowledge: Quiz 1.を解いてみる。
その他参考書籍
- Pythonチュートリアル 第2版
- Python クックブック 第2版 (原書(最新版))
- Programming Python
- Python Pocket Reference (Pocket Reference (O'Reilly))
Test Your Knowledge: Quiz 1.
コード(BBEdit)
sample7.py
#!/usr/bin/env python3 #-*- coding: utf-8 -*- a = 1 b = 1 c = 1 print(a, b, c) # Multiple-target assignment a = b = c = 2 print(a, b, c) # Tuple assignment a, b, c = 3, 3, 3 print(a, b, c)
入出力結果(Terminal, IPython)
$ ./sample1.py 1 1 1 2 2 2 3 3 3 $
0 コメント:
コメントを投稿