if_stmt ::= "if" assignment_expression ":" suite
("elif" assignment_expression ":" suite)*
["else" ":" suite]
usage :
if EXPRESSION1:
SUITE1
elif EXPRESSION2:
SUITE2
else:
SUITE
Common operators :
with_stmt ::= "with" ( "(" with_stmt_contents ","? ")" | with_stmt_contents ) ":" suite
with_stmt_contents ::= with_item ("," with_item)*
with_item ::= expression ["as" target]
usage :
with EXPRESSION as TARGET:
SUITE
perhaps
with A() as a, B() as b:
SUITE
perhaps
with A() as a:
with B() as b:
SUITE
perhaps
with (
A() as a,
B() as b,
):
SUITE
match_stmt ::= 'match' subject_expr ":" NEWLINE INDENT case_block+ DEDENT
subject_expr ::= star_named_expression "," star_named_expressions?
| named_expression
case_block ::= 'case' patterns [guard] ":" block
usage :
match variable: # there variable It's what needs to be judged
case ["quit"]:
statement_block_1 # The execution code of the corresponding case , When variable="quit" When the statement_block_1
case ["go", direction]:
statement_block_2
case ["drop", *objects]:
statement_block_3
... # Other case sentence
case _: # If the top case Statement misses , Then execute this code block , Be similar to Switch Of default
statement_block_default
Logistic regression algorithm
author : Zhu Han China electro
abnormal : reason : When uploa