Python Programmingを読む
Python Programming: An Introduction to Computer Science
- 作者: John M. Zelle
- 出版社/メーカー: Franklin Beedle & Assoc
- 発売日: 2003/12/01
- メディア: ペーパーバック
- 購入: 1人 クリック: 4回
- この商品を含むブログ (5件) を見る
最初の部分を読む限り、内容は大学初年度レベルらしい。
- 1.6節:The Magic of Python
- 2章:Writing Simple Programs
- Pythonでの数値の取扱い方。基本的な内容。
- 3章:Computing with Numbers
- mathライブラリの紹介
- intとLong int。
- ビルトイン関数roundで丸めることができる。
- 4章:Computing with Strings
- inputとraw_inputの違い。
>>> firstName = input("Please enter your name: ") Please enter your name: John <---エラーになる場合 Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> firstName = input("Please enter your name: ") File "<string>", line 1, in <module> NameError: name 'John' is not defined >>> firstName = input("Please enter your name: ") Please enter your name: "John" <---エラーにならない場合 >>>