2014年12月8日月曜日

開発環境

Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 3(Py Filling: Lists, Tuples, Dictionaries, and Sets)、Things to Do 3.1, 3.2, 3.3.を解いてみる。

Things to Do 3.1, 3.2, 3.3.

入出力結果(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]: years_list = [1980, 1981, 1982, 1983, 1984, 1985]

In [2]: years_list[3]
Out[2]: 1983

In [3]: years_list[-1]
Out[3]: 1985

In [4]: quit()
$

0 コメント:

コメントを投稿