Python Keynotes

106 阅读1分钟

The principal built-in types are numerics, sequences, mappings, classes, instances and exceptions. The following is a list of some keynotes on Python.

  1. Interger: unlimited precision. e.g. 1, 2, 3

  2. Floating: double in C, e.g. 1.0, 2.0, 3.0

  3. Boolean: True or False

  4. Logic operations in precedence: not, and, or.

  5. String: single quote, 'a'; double quote, "a"; triple single-quote, '''a'''; triple double-quote, """a"""; str()

  6. Concatenation operation: 'a' + 'b'

  7. NoneType: None

  8. None, 0, 0.0, "", [] will be evaluated to False.

  9. List: []

  10. Tuple: ()

  11. Set: {}

  12. Dictionary: {key:value}

  13. List and Set comprehension: [ expression context ]

  14. Control flow: if-elif-else; expr if cond else expr; for x in iterable; while cond: statements; break; continue.

  15. function and lambda: def func_name(argument_comma_seperated_list): statements; lambda argument_comma_seperated_list: <return_expression>.

  16. Sequence Slicing. [start : stop : step]