Object type | Category | Mutable? |
---|---|---|
Numbers (all) | Numeric | No |
Strings (all) | Sequence | No |
Lists | Sequence | Yes |
Dictionaries | Mapping | Yes |
Tuples | Sequence | No |
Files | Extension | N/A |
Sets | Set | Yes |
Frozenset | Set | No |
bytearray | Sequence | Yes |
Rule:
An example of nesting.
L = ['abc', [(1, 2), ([3], 4)], 5] print( L[1] )# w ww . j av a2 s . co m print( L[1][1] ) print( L[1][1][0] ) print( L[1][1][0][0] )