2014年7月16日水曜日

開発環境

Practical Programming: An Introduction to Computer Science Using Python 3 (Pragmatic Programmers) (Paul Gries (著)、Jennifer Campbell (著)、Jason Montojo (著)、Lynn Beighley (編集)、Pragmatic Bookshelf)のChapter 4(Working with Text)、4.7(Exercises) 2-a, b, c, d, e.を解いてみる。

4.7(Exercises) 2-a, b, c, d, e.

入出力結果(Terminal, IPython)

$ ipython
Python 3.4.1 (default, May 21 2014, 01:39:38) 
Type "copyright", "credits" or "license" for more information.

IPython 2.1.0 -- 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]: "They'll hibernate during the winter."
Out[1]: "They'll hibernate during the winter."

In [2]: '"Absolutely not," he said.'
Out[2]: '"Absolutely not," he said.'

In [3]: '"He said, \'Absolutely not,\'" recalled Mel.'
Out[3]: '"He said, \'Absolutely not,\'" recalled Mel.'

In [4]: print('"He said, \'Absolutely not,\'" recalled Mel.')
"He said, 'Absolutely not,'" recalled Mel.

In [5]: 'hydrogen sulfide'
Out[5]: 'hydrogen sulfide'

In [6]: 'left\\right'
Out[6]: 'left\\right'

In [7]: print(_)
left\right

In [8]: quit()
$

0 コメント:

コメントを投稿