This article has introduced three Python program statements: the if statement, the while loop, and the for loop.
本文介绍了三种Python程序语句:if语句、while循环和for循环。
A compound statement consists of a flow control instruction, followed by a colon character (:), followed by a block of program statements.
一个复合语句包括一个流控制指令,后跟一个冒号(:),然后再是一个程序语句块。
The second type of flow control statement in Python is the while loop, which executes a block of program statements while an expression evaluates True.
Python中的第二种流控制语句是while循环,它在一个表达式计算为True时执行一个程序语句块。
The if statement supports an optional else clause that indicates a block of program statements that should be processed if the Boolean expression evaluates False.
if语句支持一个可选的else子句,指示当布尔表达式计算为False时应该处理的程序语句块。
The while loop, as was the case with the if statement, supports an optional else clause containing a block of program statements executed when the expression is False.
while循环与if语句一样,支持一个可选的else子句,其中包含一个当表达式计算为False时执行的程序语句块。
Up to this point, you've seen how the if statement can be used to execute one of two blocks of program statements, depending on the value of a particular Boolean expression.
至此,已经看到了if语句可以如何用于根据一个特定布尔表达式的值,来执行两个程序语句块中的其中一个。
You can imbed the following statement in an application program or issue it interactively.
您可以在应用程序中嵌入下列语句或者交互发出该语句。
Even though the program runs on the application server, it will use the database clock in the SQL statement.
尽管程序在应用服务器上运行,但是它将使用sql语句中的数据库时钟。
The GOBACK statement specifies the logical end of a called program or invoked method.
goback语句指定了所调用的程序或方法的逻辑结束部分。
It's used as a placeholder when a statement is required, but the program logic doesn't require an action.
它用作一个占位符,即在需要一个语句,但是程序逻辑不需要操作时使用。
This program executes a dynamically prepared DB2 SQL statement to retrieve CURRENT DATE from the database.
这个程序执行一条动态生成的DB2SQL语句,从数据库中获取CURRENTDATE。
You create a Statement to execute commands to drop and recreate the table, which allows you to reset the database from this program if it becomes corrupted.
创建一个Statement来执行删除和重新创建表的命令,这允许您在数据库受损时通过此程序重置数据库。
Run from the current statement until a breakpoint (or the end of the program) is reached.
您可以从当前语句开始运行直至到达一个断点(或程序尾部)。
In a statement from Boeing, 787 program manager Scott Fancher provides some carefully chosen words to explain the most recent schedule.
在波音的声明中,波音787计划的负责人斯科特范彻(Scott Fancher)字斟句酌,说明了本次公布的日程。
Section 1 of the compositePieIndicators.pl program covers the usage statement and reading in the base pie image, as well as the triangle.vertices
pl程序的第 1部分将涉及用法声明并读入基本的饼图图像,以及 triangle.vertices 文件。
The last if statement is never executed and is used to demonstrate how the pass statement is coded in a program.
最后一个if语句永远不会执行,只是用于演示如何在程序中编写pass语句。
The aircraft will be delivered during 2012 to L-3, Finmeccanica's partner on the program, Finmeccanica said in a statement.
Finmeccanica在声明中说,这架飞机将在2012年交付给Finmeccanica在此项目的合作伙伴L - 3。
By simply adding a header file to your code and defining MEMWATCH in your GCC statement, you can track memory leaks and corruptions in your program.
只要在代码中添加一个头文件并在gcc语句中定义了MEMWATCH之后,您就可以跟踪程序中的内存泄漏和错误了。
Since the STAFF and TE01W01 records are defined in another file, named SAMPLE.egldef, the IMPORT statement will link those definitions to our program.
由于staff和te01 W 01记录被定义在另一个名为SAMPLE .egldef的文件中,import语句将把那些定义链接到我们的程序中。
The die statement halts program execution and displays text to the Web browser.
die语句会中止程序执行,并在Web浏览器上显示文本。
Replace poor performing SQL with a more optimal SQL statement without modifying the program source code.
无需修改程序源代码即可使用经过优化的sql语句替换表现不佳的SQL。
This example includes only one elif statement, but in practice you can include as many as the program needs.
本例只包含一个elif语句,而实际中可根据程序需要包含任意多个。
In the following example, we have moved the formerly raw HTML into a function of its own named print_html , which is called as the only executed statement within the PHP program.
在下面的例子中,我将前面的原始html移入它自己命名的print_html函数中,这个函数是php程序中惟一调用的执行语句。
In order for a PERL program to transform a dynamic SQL statement into executable form, you need to first use the prepare method, and then bind parameters using the bind_param method.
为了让Perl程序将动态sql语句转换成可执行的格式,需要首先使用prepare方法,然后使用bind _ param方法来绑定参数。
One method is to register the external program as a stored procedure and then use the SQL Call statement to run the program with a call to the stored procedure.
一种方法是将外部程序注册为存储过程,然后使用SQLCall语句调用存储过程来运行程序。
We wrap everything we do in an eval statement, since we don't want our program to die when an error occurs during execution.
因为不希望程序在出现执行错误时终止,所以将所有操作放在 eval语句中。
You retrieve the questionable comments from the Atom feed with the following XPath statement in the XQuery program.
在XQuery程序中使用以下xpath语句从atom提要检索可疑评论。
At this point, the break statement causes program execution to break out of the while loop, skipping the else clause.
此时,break语句导致程序执行中断while循环,跳转到else子句。
Under the old analysis, the program in Listing 2 is legal because the throw statement at *** is presumed to throw Foo, and so it is conceivable for the nested catch clause to catch a SonOfFoo.
在旧的分析下,清单2中的程序是合法的,因为 *** 处的throw语句被假定抛出Foo,因此嵌套catch 子句可以捕获 SonOfFoo。
If you find the GO to statement is missing a reference to a procedure, the program does not compile correctly.
如果发现GOTO语句缺少对某个程序的引用,那么该程序将无法正确进行编译。
应用推荐