2014年8月10日日曜日

開発環境

Learning Python (Mark Lutz (著)、Oreilly & Associates Inc)のPART Ⅱ.(Types and Operations)、Chapter 7.(String Fundamentals)、Test Your Knowledge: Quiz 7.を解いてみる。

その他参考書籍

Test Your Knowledge: Quiz 7.

The string module is different between python2.x and python3.x.

入出力結果(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]: import string

In [2]: dir(string)
Out[2]: 
['ChainMap',
 'Formatter',
 'Template',
 '_TemplateMetaclass',
 '__builtins__',
 '__cached__',
 '__doc__',
 '__file__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 '_re',
 '_string',
 'ascii_letters',
 'ascii_lowercase',
 'ascii_uppercase',
 'capwords',
 'digits',
 'hexdigits',
 'octdigits',
 'printable',
 'punctuation',
 'whitespace']

In [3]: quit()
$ ipython2-2.7 
Python 2.7.8 (default, Jul 13 2014, 17:11:32) 
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]: import string

In [2]: dir(string)
Out[2]: 
['Formatter',
 'Template',
 '_TemplateMetaclass',
 '__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 '_float',
 '_idmap',
 '_idmapL',
 '_int',
 '_long',
 '_multimap',
 '_re',
 'ascii_letters',
 'ascii_lowercase',
 'ascii_uppercase',
 'atof',
 'atof_error',
 'atoi',
 'atoi_error',
 'atol',
 'atol_error',
 'capitalize',
 'capwords',
 'center',
 'count',
 'digits',
 'expandtabs',
 'find',
 'hexdigits',
 'index',
 'index_error',
 'join',
 'joinfields',
 'letters',
 'ljust',
 'lower',
 'lowercase',
 'lstrip',
 'maketrans',
 'octdigits',
 'printable',
 'punctuation',
 'replace',
 'rfind',
 'rindex',
 'rjust',
 'rsplit',
 'rstrip',
 'split',
 'splitfields',
 'strip',
 'swapcase',
 'translate',
 'upper',
 'uppercase',
 'whitespace',
 'zfill']

In [3]: quit()
$

0 コメント:

コメントを投稿