This article mainly introduces the usage Summary of condition judgment statements and loop statements in Python. Condition statements and loop statements are the basis of Python program flow control. For more information, see
If statement
> General
While Loop statementwhile (loop condition){Execute statement ...}The While statement first evaluates the loop condition and determines whether the loop body is executed based on the result of the decision.When the result is true, the statement
1. Select Structure StatementC # Selection Structure statement is mainlyif (judging condition) {1}else{2}Returns true when the condition in the if is satisfied execution 1, only if the condition in the if is not satisfied to return false execution
Loop is one of the three basic structure of C language, in many problems need to use the loop control, such as 1~100 can not be divisible by 7 of the sum of the number, if not to use the loop, we can only 1~100 can not be divisible by 7 of the
Sequential process
You have a cup of water, which is generally like this:1. fill the cup with boiling water;2. Wait for boiling water to cool down;3. Pour it in your mouth.In this example, you can think of how to accomplish things,There must always
Chapter 10 cyclic statements
10.1 WHILE LOOP
10.2 do... while loop
10.3 For Loop
10.3.1 three elements of cyclic conditions
10.3.2 the three elements are embodied in the For Loop Structure
10.4 multi-layer Loop
10.5 summary and a few
1. If else
If else is similar to the select structure statement, similar to If else in programming language. Syntax:
If expression then execution statement[Elseif expression then execution statement][Else execution statement]End if;
Print the
6.1 simple statements
Empty statement; a semicolon // irrelevant null statement is not harmless
6.2 statement
Definition or declaration of objects or classes
6.3 compound statement (Block)
Block indicates a scope
For example, the while loop does
MySQL 7-1-Stored Procedure 1. advantages of using Stored Procedure: (1) the stored procedure runs on the server and runs fast. (2) After a stored procedure is executed once, the execution plan will reside in the cache. In future operations, you only
While
The while loop is a simple type in a PHP loop. It behaves just like the C language. The following are the basic while statements:
while (expr) statement
The meaning of this while statement is very simple. It tells PHP to repeat execution of
In PHP php loop includes while,do While,for,foreach,each and so on commonly used PHP loop statements, let me summarize my study in the cycle of some notes.
In PHP, the primary user executes the same block of code to run the specified number of times.
The while LOOP trap and shellwhile trap in shell
When writing A while LOOP, I found a problem. In the while LOOP, I assigned values to variables, Defined variables, array definitions, and other environments, and the environment became invalid
# Program process control * judgment structure * selection structure * Cycle Structure
### Judgment structure #### three formats of the IF statement ''' Java/* layer-by-layer judgment */If (conditional expression) // if only one statement is
How pseudo-code is spelledPseudo-code (PSEUDOCODE) is an algorithm description language. The purpose of using pseudo-code is to make the described algorithm easy to implement in any programming language (PASCAL,C,JAVA,ETC). As a result, pseudocode
Study: Learned this weekFirst: Loop statementsWhile statement "He will tell the compiler to execute a set of code repeatedly until a certain condition is met"His grammatical form is: while (Boolean condition) {The statement to be looped}do-while
The Python loop statement has a for and while statement, where the while statement is spoken.the general form of a while statement in Python :While condition judgment:StatementYou need to be aware of colons and indents. Also, note that there is no
PHP control statement1. IF statementIF statements are an important feature of most languages. They execute program segments based on conditions. PHP's IF statement is similar to C:If (expr)StatementAs discussed in the expression, expr is calculated
Dojo Javascript programming specifications regulate your own JavaScript writing, dojojavascript
Preface
The advantages of good JavaScript writing habits are self-evident. Today, bin Go recommends the Dojo Javascript programming specification, which
C # basic knowledge of C # BASIC program structure, C # syntax basics, etc,
Program Design Overview:
The software includes two aspects: Program and document. The programming language is a specialized language used to compile computer programs, such
Control Execution Process -- (Java study note 3), java Study NotesThe most basic form of if-else control program flow
Format:If (boolean-expresion ){Statement}OrIf (boolean-expresion ){Statement} Else {Statement}Example:
public static int testIf(int
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.