冷笑几声丶离去吧 关注:8贴子:504
  • 11回复贴,共1

Python 学习历程

只看楼主收藏回复

RT


IP属地:北京1楼2016-09-16 11:20回复
    Help on built-in function callable in module __builtin__:
    callable(...)
    callable(object) -> bool
    Return whether the object is callable (i.e., some kind of function).
    Note that classes are callable, as are instances with a __call__() method.


    IP属地:北京4楼2016-09-16 13:56
    回复
      divmod(...)
      divmod(x, y) -> (quotient, remainder)
      Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x.


      IP属地:北京6楼2016-09-19 17:50
      回复
        round(...)
        round(number[, ndigits]) -> floating point number
        Round a number to a given precision in decimal digits (default 0 digits).
        This always returns a floating point number. Precision may be negative.
        四舍五入函数。第一个数是原本数字,第二个数是保留的小数位数。


        IP属地:北京7楼2016-09-19 17:52
        回复
          pow(...)
          pow(x, y[, z]) -> number
          With two arguments, equivalent to x**y. With three arguments,
          equivalent to (x**y) % z, but may be more efficient (e.g. for longs).
          pow的第三个参数可以用来取余数。


          IP属地:北京8楼2016-09-19 17:54
          回复
            floor(...)
            floor(x)
            Return the floor of x as a float.
            This is the largest integral value <= x.
            接受一个浮点数,取整截留之后返回一个浮点数。(3.0000)


            IP属地:北京9楼2016-09-19 18:01
            回复
              ord(...)
              ord(c) -> integer
              Return the integer ordinal of a one-character string.
              返回一个字符的ascii编码。


              IP属地:北京10楼2016-09-19 21:44
              回复
                python中取出空格方法:
                strip方法:去除两边空格;
                lstrip方法:去除左边空格;
                rstrip方法:去除右边空格。
                这些方法不改变字符串,只是返回一个字符串。


                IP属地:北京12楼2016-09-19 21:48
                回复
                  help(dict.clear)
                  Help on method_descriptor:
                  clear(...)
                  D.clear() -> None. Remove all items from D.
                  清空字典的一种方法


                  IP属地:北京13楼2016-09-20 06:25
                  回复
                    The expression ``x and y`` first evaluates *x*; if *x* is false, its
                    value is returned; otherwise, *y* is evaluated and the resulting value
                    is returned.
                    and 的help解释全文如下:
                    Boolean operations
                    ******************
                    or_test ::= and_test | or_test "or" and_test
                    and_test ::= not_test | and_test "and" not_test
                    not_test ::= comparison | "not" not_test
                    In the context of Boolean operations, and also when expressions are
                    used by control flow statements, the following values are interpreted
                    as false: ``False``, ``None``, numeric zero of all types, and empty
                    strings and containers (including strings, tuples, lists,
                    dictionaries, sets and frozensets). All other values are interpreted
                    as true. (See the ``__nonzero__()`` special method for a way to
                    change this.)
                    The operator ``not`` yields ``True`` if its argument is false,
                    ``False`` otherwise.
                    The expression ``x and y`` first evaluates *x*; if *x* is false, its
                    value is returned; otherwise, *y* is evaluated and the resulting value
                    is returned.
                    The expression ``x or y`` first evaluates *x*; if *x* is true, its
                    value is returned; otherwise, *y* is evaluated and the resulting value
                    is returned.
                    (Note that neither ``and`` nor ``or`` restrict the value and type they
                    return to ``False`` and ``True``, but rather return the last evaluated
                    argument. This is sometimes useful, e.g., if ``s`` is a string that
                    should be replaced by a default value if it is empty, the expression
                    ``s or 'foo'`` yields the desired value. Because ``not`` has to
                    invent a value anyway, it does not bother to return a value of the
                    same type as its argument, so e.g., ``not 'foo'`` yields ``False``,
                    not ``''``.)
                    Related help topics: EXPRESSIONS, TRUTHVALUE


                    IP属地:北京15楼2016-09-20 06:59
                    回复
                      sorted(...)
                      sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list
                      应用任意可迭代对象生成列表..


                      IP属地:北京19楼2016-09-25 18:44
                      回复