• 重新梳理Python基础(8)


    1. 整理python的关键字

    # _*_ coding:utf-8 _*_
    and
    del #删除list中的某个元素或者这个list,同样适用于字典
    from
    not
    while
    as
    elif
    global
    or
    with #http://www.cnblogs.com/Brogrammer/archive/2012/07/23/2605570.html
    assert #assert语句用来声明某个条件是真的。例如,如果你非常确信某个你使用的列表中至少有一个元素,而你想要检验这一点,并且在它非真的时候引发一个错误,那么assert语句是应用在这种情形下的理想语句。当assert语句失败的时候,会引发一个AssertionError。
    else
    if
    pass
    yield # http://developer.51cto.com/art/201301/379132.htm
    break
    except #类似于try...catch语句
    import
    print
    class
    exec #exec语句用来执行储存在字符串或文件中的Python语句。例如,我们可以在运行时生成一个包含Python代码的字符串,然后使用exec语句执行这些语句。
    in
    raise
    continue
    finally
    is
    return
    def
    for
    lambda
    try

    2. 数据类型

    View Code
    True
    False
    None
    strings
    numbers
    floats
    lists

    3. 字符串输出格式

    View Code
    %d
    %i
    %o
    %u
    %x
    %X
    %e
    %E
    %f
    %F
    %g
    %G
    %c
    %r
    %s
    %%

    4. 运算符

    View Code
    +
    -
    *
    **
    /
    //
    %
    <
    >
    <=
    >=
    ==
    !=
    <>
    ( )
    [ ]
    { }
    @
    ,
    :
    .
    =
    ;
    +=
    -=
    *=
    /=
    //=
    %=
    **=
  • 相关阅读:
    window.open跨页面传输
    history对象
    类vr特效的360度全景
    移动端图片滑动
    图片拼图
    20180808 考试记录
    [jzoj 5770]【2018提高组模拟A组8.6】可爱精灵宝贝 (区间dp)
    20180806 考试记录
    [luogu2319 HNOI2006] 超级英雄 (匈牙利算法)
    [luogu2679] 子串 (多维dp)
  • 原文地址:https://www.cnblogs.com/dollarzhaole/p/2972232.html
Copyright © 2020-2023  润新知