An introductory Python statement that includes an if statement, a while statement, and a for statement for the Python beginner's reference.
If statement Example
name = ' Peirong ';
If name = = ' Peirong ':
print ' is Peirong ';
Elif name== ' Maojun ':
print ' This is
Here is a typical decision to make if ... Else the general form of the structure is used in most programming languages:
If statement:
The If statement consists of a Boolean expression followed by one or more statements. Grammar:
Syntax for an IF statement:
if (boolean_expression)
{
Statements'll execute if the Boolean expression is true
}
If the value of the
Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT., mysqlbinlogI. Problem Description014-12-15 20:00:29 4398 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT =
operatorsdocument.write (3>2 4>3); The entire expression is ture, or flase, when the two are ture. .document.write ("document.write (3>2 4document.write ("document.write (4>3 | | 3>2); Non-op! is simply to change true to Flase,flase to Truedocument.write ("document.write (! ( 3>2));document.write ("The IF statement is the most commonly used conditional selection statement. There are three types of if sta
The pass statement is like 0 in mathematics,
does not have any practical meaning, but it is a character that does exist. So, Python
Pass Statementis an empty statement, in order to maintain the integrity of the program structure,
PassDon't do anything, general
Used as a placeholder statement,
The effect is the same as break, the meaning is completely opposite.
Label:1: Error log mass error 150602 14:40:02 [Warning] Unsafe statement written to the binary log using statement format since Binlog_format = Statemen T. INSERT ... SELECT ... On DUPLICATE KEY UPDATE was unsafe because the order in which rows be retrieved by the SELECT determines which (if any) RO WS is updated. This order cannot is predicted and may differ on master and the slave. Statement:insert into T
If,elseIf if, else is another meaning, if the condition is determined within the parentheses, if the condition is met, the IF statement executes the command and if it does not, the IF statement is not entered.The basic format:①if (...) Conditions are judged in parentheses{program code, arithmetic, etc.}②if (...) Conditions are judged in parentheses{program code, arithmetic, etc.}else//if the IF condition is
Java Control statement -- switch statement and modify witch statement
The equivalent judgment of the above if statement can be replaced by switch.
Note that break is usually added after each case, indicating that the current case has been executed; prevent case penetration, that is, continue to execute the case u
1. INSERT statement Format
(1) INSERT into table name (column 1, column 2 ...) Column n) value (value 1, value 2,.... Value n); the type and order of the columns and values must be one by one corresponding, the ignored columns must allow null values to be inserted, and the columns can be in any order when inserted, but the values must correspond to the
(2) Other: Execute system stored procedure, query the attribute information of the table, EXEC sp_
If statements skip this statement and execute the next statement. how to write a lot of data into the database?
For example, if ($ a = 2 ){
Skip this entry
}
How should I write the code? the full code is directly provided by the eldest brother. thank you!
Reply to discussion (solution)
If ($! = 2 ){Skip this entry}
When $ a = 2, the data is not written to the database, and the next
If ($! = 2 ){Exec
the format of awhile loop statement:
1. Format:
while (condition of the loop) { loop statement;}
2, while the Loop statement to note matters:1) The While Loop statement is typically the number of times a variable is controlled by its loop.2) The Loop body code of the WHILE loop
This article records the more interesting things, but also more important. Let's take a look at the break statement first. The Python break statement, like in the C language, breaks the minimum enclosing for or while loop. The break statement terminates the Loop statement, that is, the loop condition does not have a fa
An if (conditional expression) statement
The IF statement is a conditional judgment statement, and for an expression in parentheses in the IF statement, ECMAScript automatically calls the Boolean () transformation function to convert the result of the expression to a Boolean value. If the value is true, execute th
the form of a while statement:while ( expression )Statementin the form of a for statement:For (expression1; expression2;expression3)//( initialization, condition, adjustment )StatementThe break statement functions in both the for statement and the while statement: permanently terminates its loop, while the continue statement
use ORDER by rand (), it is likely to lead to the disaster of MySQL!!7, each table should be set an ID primary key, the best is an int type, and set on the automatic addition of the AUTO_INCREMENT flag, which should be used as the design table structure of the first thing must do!!8. Split the large DELETE or INSERT statement. Because these two operations will lock the table, the table is locked, and other operations are not in, as far as I would rat
Jumps out of the specified for loop body, and Goto is much like1 k:for (int i=0;i java-three large statements (SELECT statement, conditional statement, loop statement)
Document directory
General functions
Function for testing sequence capacity
Equals, union, intersection and except T
Aggregate functions
Generation sequence Functions
Access Functions
Name
Description
FN: node-Name (node)
Objective
Process Control statement:
In the process of executing a program, the order of execution of each statement has a direct effect on the result of the program. That is to say, the process of the program has a direct impact on the running result. Therefore, we must understand the execution process of each statement. Also, many times we have to implement t
SQL statement optimization improves database performance and SQL statement database performance
In systems with unsatisfactory performance, apart from the fact that the application load exceeds the server's actual processing capacity, it is more because the system has a large number of SQL statements that need to be optimized. To achieve stable execution performance, the simpler the SQL
We have explained a multi-choice elseif statement. Although this statement can be used for multiple judgments, many if statements need to be written during use, which makes the readability of our program inconvenient, to avoid too many if statements and improve the readability of our program, you can use multiple switch judgment statements. in this chapter, we will introduce the "switch
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.