2015年1月21日水曜日

開発環境

Introducing Python: Modern Computing in Simple Packages(Bill Lubanovic (著)、 O'Reilly Media)のChapter 7(Mangle Data Like a Pro)、Things to Do 7.4.を解いてみる。

Things to Do 7.4.

コード(BBEdit)

sample4.py

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

print('My kitty cat likes %s,' % 'roast beef',
      'My kitty cat likes %s,' % 'ham',
      'My kitty cat fell on his %s,' % 'head',
      'And now thinks he\'s a %s.' % 'calm',
      sep='\n')
      

入出力結果(Terminal, IPython)

$ ./sample4.py
My kitty cat likes roast beef,
My kitty cat likes ham,
My kitty cat fell on his head,
And now thinks he's a calm.
$

0 コメント:

コメントを投稿