test_magic.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:leetcode 作者: thomasyimgit 项目源码 文件源码
def doctest_precision():
    """doctest for %precision

    In [1]: f = get_ipython().display_formatter.formatters['text/plain']

    In [2]: %precision 5
    Out[2]: {u}'%.5f'

    In [3]: f.float_format
    Out[3]: {u}'%.5f'

    In [4]: %precision %e
    Out[4]: {u}'%e'

    In [5]: f(3.1415927)
    Out[5]: {u}'3.141593e+00'
    """
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号