1. Statements
What is the difference between a 1.1 statement and an expression? An expression is something, and the statement is doing something (that is, telling the computer what to do). For example, 2*2 is 4, while print2*2 prints 4.
1.2 If statement
When the condition is false, nothing happens; when the condition is true, the subsequent statement (for the print statement) is executed. Note: Using the IF statement within the interactive interpreter requires a two-time carriage return and the IF statement executes
2. Get user input
The statement after the Python prompt (>>>) can be counted as part of a complete program, the value entered is provided by the user, and the program prints the product of the two number of inputs 1428. When writing a program, you do not need to know what number the user has entered.
3. Functions
Functions, like small programs, can be used to implement specific functions. Python has many functions, such as the standard functions such as POW, which are called built-in functions, or you can customize functions. The way to use a function is called a call function. Because a value is returned, a function call can be simply considered as a different expression. We can use a combination of function calls and operators to create more complex expressions:
Python Introductory Learning--statements, getting user input, functions