Hướng dẫn how do i see all methods in python? - làm cách nào để xem tất cả các phương thức trong python?

Tôi tin rằng bạn muốn một cái gì đó như thế này:

Show

một danh sách các thuộc tính từ một đối tượng

Chức năng tích hợp dir() có thể làm công việc này.

Lấy từ đầu ra help(dir) trên vỏ Python của bạn:

dir(...)

dir([object]) -> list of strings

Nếu được gọi không có đối số, hãy trả lại tên trong phạm vi hiện tại.

Khác, trả về một danh sách các tên bao gồm (một số) các thuộc tính của đối tượng đã cho và của các thuộc tính có thể truy cập được từ nó.

Nếu đối tượng cung cấp một phương thức có tên

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> a = "I am a string"
>>>
>>> type(a)

>>>
>>> dir(a)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
'__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'_formatter_field_name_split', '_formatter_parser', 'capitalize',
'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill']
0, nó sẽ được sử dụng; Nếu không thì logic Dir () mặc định được sử dụng và trả về:

  • Đối với một đối tượng mô -đun: Các thuộc tính của mô -đun.
  • Đối với một đối tượng lớp: các thuộc tính của nó và đệ quy các thuộc tính của các cơ sở của nó.
  • Đối với bất kỳ đối tượng nào khác: các thuộc tính của nó, các thuộc tính của lớp và đệ quy các thuộc tính của các lớp cơ sở của lớp.

Ví dụ:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> a = "I am a string"
>>>
>>> type(a)

>>>
>>> dir(a)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
'__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'_formatter_field_name_split', '_formatter_parser', 'capitalize',
'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill']

❮ Chức năng tích hợp sẵn


Thí dụ

Kiểm tra xem tất cả các mục trong danh sách có đúng không:

mylist = [true, true, true] x = all (mylist)
x = all(mylist)

Hãy tự mình thử »


Định nghĩa và cách sử dụng

Hàm

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> a = "I am a string"
>>>
>>> type(a)

>>>
>>> dir(a)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
'__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'_formatter_field_name_split', '_formatter_parser', 'capitalize',
'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill']
1 trả về true nếu tất cả các mục trong một điều có thể là đúng, nếu không nó sẽ trả về sai.

Nếu đối tượng có thể trống, hàm

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> a = "I am a string"
>>>
>>> type(a)

>>>
>>> dir(a)
['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
'__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
'__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'_formatter_field_name_split', '_formatter_parser', 'capitalize',
'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
'translate', 'upper', 'zfill']
1 cũng trả về đúng.


Cú pháp

Giá trị tham số

Tham sốSự mô tả
Có thể lặp lạiMột đối tượng có thể đi được (danh sách, tuple, từ điển)

Nhiều ví dụ hơn

Thí dụ

Kiểm tra xem tất cả các mục trong danh sách có đúng không:

mylist = [true, true, true] x = all (mylist)
x = all(mylist)

Hãy tự mình thử »

Thí dụ

Kiểm tra xem tất cả các mục trong một tuple có đúng không:

mytuple = (0, true, false) x = all (mytuple)
x = all(mytuple)

Hãy tự mình thử »

Thí dụ

Kiểm tra xem tất cả các mục trong một tuple có đúng không:

mytuple = (0, true, false) x = all (mytuple)
x = all(myset)

Hãy tự mình thử »

Thí dụ

Kiểm tra xem tất cả các mục trong một tuple có đúng không:

mytuple = (0, true, false) x = all (mytuple)
x = all(mydict)

Hãy tự mình thử »

Kiểm tra xem tất cả các mục trong một bộ có đúng không: When used on a dictionary, the all() function checks if all the keys are true, not the values.


myset = {0, 1, 0} x = all (myset)

Kiểm tra xem tất cả các mục trong từ điển có đúng không:


mydict = {0: "Apple", 1: "Orange"} x = All (MyDict)


Xem thảo luận

Cải thiện bài viết

Lưu bài viết

  • Đọc
  • Bàn luận
  • Xem thảo luận

    Cải thiện bài viết

    Lưu bài viết

    ĐọcPython all() function returns true if all the elements of a given iterable (List, Dictionary, Tuple, set, etc.) are True otherwise it returns False. It also returns True if the iterable object is empty. Sometimes while working on some code if we want to ensure that user has not entered a False value then we use the all() function.

    Bàn luận

    Hàm python all () trả về đúng nếu tất cả các yếu tố của một số không thể sử dụng được (danh sách, từ điển, tuple, set, v.v.) là đúng nếu không nó trả về sai. Nó cũng trả về đúng nếu đối tượng có thể trống. Đôi khi trong khi làm việc trên một số mã nếu chúng tôi muốn đảm bảo rằng người dùng chưa nhập giá trị sai thì chúng tôi sử dụng hàm All ().all( iterable )

    • Chức năng python all () trong Python It is an iterable object such as a dictionary,tuple,list,set,etc.

    Cú pháp: Tất cả (có thể lặp lại)boolean

    Có thể sử dụng được: Đó là một đối tượng có thể lặp lại như từ điển, tuple, danh sách, bộ, v.v.

    Python3

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    6
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    7
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    7
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1
    False
    2

    Output:

    False

    Trả lại: Boolean

    Chức năng python all () với ví dụ

    Python3

    Ví dụ 1: Làm việc của tất cả () với danh sách

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    True
    False
    False
    True
    5

    Ở đây chúng tôi đang coi danh sách là một điều có thể.

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    True
    False
    False
    True
    5

    False
    3
    False
    4
    False
    5
    False
    6
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    8
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    True
    False
    False
    True
    0
    True
    False
    False
    True
    1

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    True
    False
    False
    True
    5

    False
    3
    False
    4
    False
    5
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1
    True
    False
    False
    True
    1

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    True
    False
    False
    True
    5

    Output:

    True
    False
    False
    True

    False
    3
    False
    4
    True
    False
    False
    True
    8

    Ví dụ 2: làm việc của tất cả () với bộ dữ

    Ở đây chúng tôi đang coi một tuple là một điều có được.

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5dir()5

    Python3

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5dir()5

    True
    True
    True
    3
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    True
    True
    True
    6
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    6
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    True
    False
    False
    True
    6dir()1

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5dir()5

    True
    True
    True
    3
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1dir()1

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5dir()5

    Output:

    True
    False
    False
    True

    True
    True
    True
    3
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    18

    Python3

    Ví dụ 3: làm việc của tất cả () với các bộ

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    Ở đây các bộ được gọi là Iterables

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    23
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    25
    True
    False
    False
    True
    0
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    True
    False
    False
    True
    0
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    06
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    31

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    23
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    25
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    31

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    Output:

    True
    False
    False
    True

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    23
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    68

    Python3

    Ví dụ 4: làm việc của tất cả () với từ điển

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    87

    Ở đây chúng tôi đang xem xét từ điển là lặp đi lặp lại.

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    87

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    73
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    25
    True
    False
    False
    True
    0
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    777____178
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8__

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    87

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    73
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    25
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    77
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    78
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    8
    False
    1
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    777____182
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    31

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    73
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    25
    True
    False
    False
    True
    9
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    77__ con

    Output:

    True
    False
    False
    True

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    73
    False
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    68
    In the case of a dictionary if all the keys of the dictionary are true or the dictionary is empty the all() returns True, else it returns False.

    Python3

    Lưu ý: Trong trường hợp từ điển nếu tất cả các khóa của từ điển là đúng hoặc từ điển trống, tất cả () trả về đúng, nếu không nó sẽ trả về sai.

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    Ví dụ 5: làm việc của tất cả () với chuỗi

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    23
    False
    4
    False
    31

    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    3
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    4
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    5
    $ python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    
    >>> a = "I am a string"
    >>>
    >>> type(a)
    
    >>>
    >>> dir(a)
    ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
    '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__',
    '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__',
    '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__',
    '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__',
    '__setattr__', '__sizeof__', '__str__', '__subclasshook__',
    '_formatter_field_name_split', '_formatter_parser', 'capitalize',
    'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find',
    'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace',
    'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition',
    'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip',
    'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
    'translate', 'upper', 'zfill']
    
    35

    Output:

    True
    True
    True

    Làm cách nào để kiểm tra các phương thức trong Python?

    Cách đơn giản nhất để có được danh sách các phương thức của bất kỳ đối tượng nào là sử dụng lệnh help ().Nó sẽ liệt kê tất cả các phương pháp có sẵn/quan trọng liên quan đến đối tượng đó.use the help() command. It will list out all the available/important methods associated with that object.

    Làm cách nào để liệt kê tất cả các phương thức trong mô -đun Python?

    Chúng tôi có thể liệt kê tất cả các hàm có trong mô -đun Python bằng cách sử dụng phương thức Dir () trong vỏ Python hoặc trong Shell Promption Shell.using the dir() method in the Python shell or in the command prompt shell.

    Làm thế nào để bạn sử dụng tất cả các phương thức trong Python?

    Chức năng python - tất cả () hàm python tất cả () trả về đúng nếu tất cả các phần tử của một số không thể sử dụng được (danh sách, từ điển, tuple, set, v.v.) là đúng nếu không nó sẽ trả về sai.Nó cũng trả về đúng nếu đối tượng có thể trống.returns true if all the elements of a given iterable (List, Dictionary, Tuple, set, etc.) are True otherwise it returns False. It also returns True if the iterable object is empty.

    Tất cả () trong Python là gì?

    Python tất cả () hàm chức năng tất cả () trả về đúng nếu tất cả các mục trong một điều có thể là đúng, nếu không nó sẽ trả về sai.Nếu đối tượng có thể xóa, hàm tất cả () cũng trả về true.returns True if all items in an iterable are true, otherwise it returns False. If the iterable object is empty, the all() function also returns True.