zoukankan      html  css  js  c++  java
  • 语句和语法

      python语句                角色          例子

        赋值                创建引用值      a,b,c='good','bad','apple'

        调用                执行函数       log.write("spam,ham ")

        print                打印对象       print "hello world"

        if/elif/else              选择         if "python" in text

                                       print text

        for/else              序列迭代        for x in mylist

                                       print x

        while/else             一般循环        while x>y

                                        print ”x“

        pass                空占位符        while Ture

                                        pass

        break,continue           循环跳跃        while True

                                        if not line: break

        try/except/finally          捕捉异常        try:

                                          action()

                                       except:

                                          print 'action error'

        raise                 触发异常        raise endSearch,location

        import,from             模块读取

  • 相关阅读:
    New Concept English Two 20 52
    timer Compliant Controller project (3)--bom and sch
    New Concept English Two 19 49
    CAM350对比两个gerber之间的差异
    New Concept English Two 18 46
    timer Compliant Controller project (2)--Project Demonstration
    New Concept English Two 17 43
    第15.7节 PyQt入门学习:PyQt5应用构建详细过程介绍
    第15.6节 PyQt5安装与配置
    第15.5节 PyQt的历史沿革介绍
  • 原文地址:https://www.cnblogs.com/st12345/p/6419232.html
Copyright © 2011-2022 走看看