開発環境
- macOS High Sierra - Apple
- Emacs (Text Editor)
- Python 3.6 (プログラミング言語)
入門 Python 3 (Bill Lubanovic (著)、斎藤 康毅 (監修)、長尾 高弘 (翻訳)、オライリージャパン)の3章(Pyの具: リスト、タプル、辞書、集合)、3.8(復習問題)3-1、2、3.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3 print('1.') years_list = list(range(1980, 1986)) print(years_list) print('2.') print(years_list[3]) print('3.') print(years_list[-1])
入出力結果(Terminal, Jupyter(IPython))
$ ./sample1.py 1. [1980, 1981, 1982, 1983, 1984, 1985] 2. 1983 3. 1985 $
0 コメント:
コメントを投稿