constantsSecond, operatorArithmetic Operators+ 、-、 *,/,% (remainder operation can only be used for integer type)Relational Operators> >= == !=logical Operators! | | (the expression whose connection is evaluated from left to right, and stops the calculation immediately after knowing that the result value is False or True )bitwise operators (only for integer operands) (to be continued ...) )~ | ^ Type Conversions (when several operand types of an operator are different, they need to be converte
, output vectorsSeq ()# arithmetic progressionSTR ()# Each property of the data frameSummary ()# Calculates basic statistics for all columnsTable ()# computed column tableTapply () # function operations on all subsetsUnique ()# Find tick valueVector ()# spawn Vectors# environment and loading, output dataRead.table ()# Read Data fileScan ()# Read Data fileSETWD ()# Set Current working directoryWrite.table ()# output file# drawingJPEG ()# open JPG imagePlot ()# Scatter chartDev.off ()# Close pictu
Description 1.switch is clearer and more readable than if...else statements 2.python does not provide a switch statement
3.pthon uses a dictionary to implement the switch statement function, the implementation method is divided into 2 steps:A. Define a dictionary;B. Call the dictionary get () to get the corresponding expressionPython code:
def add(x,y):
return x+y
def sub(x,y):
return x-y
def mul(x,y):
return x*y
def div(x,y):
return x/y
operation={
1. Statements are executed on a line-by-row basis, unless you do not writeIf the statement uses an if statement, his execution is jumping, and the IF statement is the process control2. Automatic boundary detection of blocks and statementsBecause Python does not have curly braces for these bounding symbols, it uses code indentation to control boundariesSimilarly, the end of a statement is not using semicolons, but also using code indentationIn the above example, for the indentation before the for
role: This function is mainly for the purpose of serialization objects. Maybe some people are allergic to the word serialization, my understanding is very simple. This means converting the type of the object to a string type (or, more specifically, the JSON type). It's so simple. For example, you have a class, so you can convert it to the corresponding JSON type by this method. It's simple.Then look.Syntax:Json.stringify (value [, Replacer] [, space])Value: is the required field. Is the object y
add a withxxx,xxx is the first parameter infix)Then I must declare this: Func Processdata2withparamaa (paramaa:string,paramab:string) {}Crouching trough, what a ghost!!And then call it? There is a wood in the outside of the brackets. There's no sense of paramaa inside. Processdata2withparamaa ("a""b")The OC call function is like this [self processdatawithparamaa:@ "A" paramab:@ "B"]Both sides are in brackets.This elegance your swift braces don't learn.Fortunately, the development of t
the Python standard library.1) Network application based on socket layerSockets are the bottom line of the Network Programmability section. With the socket package, we can manage the socket directly, such as assigning a socket to a port, connecting a remote port, and transferring data over a connection. We can also use the Socketserver package to build servers more easily. With multi-threaded and multi-process coordination, the establishment of multi-threaded or multi-process server, can effect
1 //input A, B, output a+b2 /*#include 3 int main ()4 {5 int A, b;6 scanf ("%d%d", a,b);7 printf ("%d", a+b);8 }*/9 /*Ten //Enter a character to return his ASCLL code One #include A int main () - { - char A; the scanf ("%c", a); - printf ("%d", a); - }*/ - + -#include + intMain () A { at CharA; - Charb; - while(scanf ("%c%c", a,b)!=eof)//when there is a space in the middle, the input parameters should also have a space, when there is no space, you do not have to enter a space.
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.