2015年4月8日水曜日

開発環境

  • OS X Yosemite - Apple (OS)
  • Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
  • Python 3.4 (プログラミング言語)

Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 10(Systems)、Things to Do 10.9.を解いてみる。

Things to Do 10.9.

コード(Eacs, BBEdit)

#!/usr/bin/env python3
# -*-c doing: utf-8 -*_

import datetime

birth = datetime.date(2000, 1, 2)
days_old = birth + datetime.timedelta(days=10000)

print(birth, days_old, sep='\n')


入出力結果(Terminal, IPython)

$ ./sample9.py
2000-01-02
2027-05-20
$

0 コメント:

コメントを投稿