zoukankan      html  css  js  c++  java
  • Python 入门日记(一)—— Hello World!

    2020.07.04 Python 入门的 Day1

    成就:语言通用入门程序 “Hello World”

    print("Hello World!")
    message = "Hello Python World!"
    print(message)
    message = "LBWNB!"
    print(message)

    附录:Python 变量的命名规则

    • 变量名只能包含字母、数字和下划线。变量名只能以字母或下划线开头,不能使用数字开头。
    • 变量名不能包含空格,但可以使用下划线分隔其中的单词。
    • 不要将 Python 关键字和函数名作为变量名。
    • 变量名应该既简短又具有描述性。
    • 就目前而言,应使用小写的 Python 变量名。在变量名中使用大写字母虽然不会导致错误,但避免使用大写字母是个不错的主意

    附录:Python 关键字

    • False        class        finally        is        return
    • None        continue        for        lambda        try
    • True        def        from        nonlocal        while
    • and        del        global        not        with
    • as        elif        if        or        yield
    • assert        else        import        pass
    • break        except        in        raise

    附录:Python 内置函数

    • abs()        divmod()        input()        open()        staticmethod()        
    • all()        enumerate()        int()        ord()        str()        
    • any()        eval()        isinstance()        pow()        sum()        
    • basestring()        execfile()        issubclass()        print()        super()        
    • bin()        file()        iter()        property()        tuple()        
    • bool()        filter()        len()        range()        type()        
    • bytearray()        float()        list()        raw_input()        unichr()        
    • callable()        format()        locals()        reduce()        unicode()        
    • chr()        frozenset()        long()        reload()        vars()        
    • classmethod()        getattr()        map()        repr()        xrange()        
    • cmp()        globals()        max()        reversed()zip()        Zip()        
    • compile()        hasattr()        memoryview()        round()        _import_()        
    • complex()        hash()        min()        set()        apply()        
    • delattr()        help()        next()        setattr()        buffer()        
    • dict()        hex()        object()        slice()        coerce()        
    • dir()        id()        oct()        sorted()        intern()        

    ——《Python 编程 从入门到实践》(美·Eric Matthes  著        袁国忠  译)

  • 相关阅读:
    P1271 【深基9.例1】选举学生会(基数排序)
    P7076 [CSP-S2020] 动物园
    #10127. 「一本通 4.3 练习 1」最大数
    P2671 [NOIP2015 普及组] 求和
    P3369 【模板】普通平衡树
    P2503 [HAOI2006]均分数据
    P2846 [USACO08NOV]Light Switching G(动态开点写法)
    P6278 [USACO20OPEN]Haircut G
    P2341 [USACO03FALL][HAOI2006]受欢迎的牛 G
    P1012 [NOIP1998 提高组] 拼数
  • 原文地址:https://www.cnblogs.com/A-Tree/p/13236916.html
Copyright © 2011-2022 走看看