• 第14天补充


    枚举,   format    zip

    print(format('test', '<20'))          加20个 这个什么也没加是空格,加啥加啥   左对齐

    print(format('test', '>20'))          加20个    右对齐

    print(format('test', '^20'))   加20个   居中

    print(format(3, 'b'))                二进制 b就是bin 转成2进制

    print(format(97, 'c'))             转换成unicode字符

    print(format(11, 'd'))              十进制  d不知道单词开头是啥

    print(format(11, 'o'))              八进制    o   oct

    print(format(11, 'x'))              十六进制    hex

    print(format(11, 'X'))              十六进制   大写   hex

    format还有一个难的

    问了问老师也无果 先写一写吧

    print(format(123456789, 'e'))              科学计数法默认保留6位小数                   如果位数过多,就是1,2-1 不等于0,2的梗了
    print(format(123456789, '0.2e'))           科学计数法保留2位小数(小写)           再说e,e是不管你怎么弄 都是第一个数后面有小数点,然后小数点后面的数保留几位,自己定,默认6位
    print(format(123456789, '0.2E'))         科学计数法保留2位小数(大写)           先说e的大小写区别,没毛区别,就是说格式的事,大写的比较正式
    print(format(1.23456789, 'f'))              小数点计数法保留6位小数
    print(format(1.23456789, '0.2f'))       小数点计数法保留2位小数                       这个是被小数点控制的,小数点定在哪,他就在小数点后面保留几个小数

    print(format(1.23456789, '0.10f')) #   小数点计数法. 保留10位小数       

    print(format(1.23456789e+10000, 'F')) #    小数点计数法.          1e1就是1的10的1次方   这个。。。。

    枚举

    lst = ["alex", "wusir", "taibai"]
    for index, el in enumerate(lst):
    print(str(index)+"==>"+el)

    0==>alex
    1==>wusir
    2==>taibai             这个的话背一背就可以了   背又不知道啥时候能背下来

    前面的是索引后面的是元素






  • 相关阅读:
    linux 调试利器gdb, strace, pstack, pstree, lsof
    使用Istio治理微服务入门
    JAVA多线程及线程状态转换
    Oracle
    RMA Sales Order – Stuck with “Awaiting Return Disposition”
    XP中IIS“HTTP 500
    Oracle ERP View
    WIP and COST Frequently Used Troubleshooting Scripts (Doc ID 105647.1)
    SQL -- What Tables Queries are Used to Display the Counts in the Inventory Account Periods form (INVTTGPM.fmb) (Doc ID ID 357997.1)
    oracle ebs 11i > concurrent programs –> request group –> responsibility
  • 原文地址:https://www.cnblogs.com/Mrszhao/p/9484088.html
Copyright © 2020-2023  润新知