2014年12月7日日曜日

開発環境

Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 2(Py Ingredients: Numbers, Strings, and Variables)、Things to Do 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.を解いてみる。

Things to Do 2.1, 2.2, 2.3, 2.4, 2.5, 2.6.

入出力結果(Terminal, IPython)

$ ipython
Python 3.4.2 (default, Nov  1 2014, 16:32:22) 
Type "copyright", "credits" or "license" for more information.

IPython 2.3.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: 60 * 60
Out[1]: 3600

In [2]: seconds_per_hour = _

In [3]: seconds_per_hour
Out[3]: 3600

In [4]: seconds_per_hour * 24
Out[4]: 86400

In [5]: seconds_per_day = seconds_per_hour * 24

In [6]: seconds_per_day
Out[6]: 86400

In [7]: seconds_per_day / seconds_per_hour
Out[7]: 24.0

In [8]: seconds_per_day // seconds_per_hour
Out[8]: 24

In [9]: quit()
$

0 コメント:

コメントを投稿