cs_lang:python:things-to-know:native-datatypes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| cs_lang:python:things-to-know:native-datatypes [2010/12/12 18:05] – cedric | cs_lang:python:things-to-know:native-datatypes [2011/01/11 14:26] (current) – cedric | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| ====== Booleans ====== | ====== Booleans ====== | ||
| <code python> | <code python> | ||
| + | >>> | ||
| + | >>> | ||
| + | True | ||
| + | >>> | ||
| + | False | ||
| + | >>> | ||
| >>> | >>> | ||
| True | True | ||
| Line 31: | Line 37: | ||
| </ | </ | ||
| + | <code python> | ||
| + | >>> | ||
| + | >>> | ||
| + | >>> | ||
| + | True | ||
| + | >>> | ||
| + | False | ||
| + | >>> | ||
| + | False | ||
| + | >>> | ||
| + | True | ||
| + | >>> | ||
| + | True | ||
| + | True | ||
| + | </ | ||
| ====== Numbers ====== | ====== Numbers ====== | ||
| Line 123: | Line 144: | ||
| </ | </ | ||
| - | ===== List comprehension ===== | ||
| - | <code python> | ||
| - | >>> | ||
| - | [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98] | ||
| - | >>> | ||
| - | >>> | ||
| - | [True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True, False, True] | ||
| - | </ | ||
| + | |||
| + | ====== Dictionaries ====== | ||
| + | <code python> | ||
| + | >>> | ||
| + | >>> | ||
| + | >>> | ||
| + | Traceback (most recent call last): | ||
| + | File "< | ||
| + | KeyError: ' | ||
| + | >>> | ||
| + | False | ||
| + | >>> | ||
| + | >>> | ||
| + | {' | ||
| + | >>> | ||
| + | >>> | ||
| + | >>> | ||
| + | dict_keys([' | ||
| + | >>> | ||
| + | dict_values([' | ||
| + | </ | ||
cs_lang/python/things-to-know/native-datatypes.1292173518.txt.gz · Last modified: by cedric
